CodeQL library for C/C++
codeql/cpp-all 2.0.2-dev (changelog, source)
Search

Module Specifier

Provides classes for modeling specifiers and attributes.

Import path

import semmle.code.cpp.Specifier

Imports

Element

Provides the Element class, which is the base class for all classes representing C or C++ program elements.

Classes

AccessSpecifier

A C++ access specifier: public, protected, or private.

AlignAs

A C++11 alignas construct. For example the attribute in the following code: struct alignas(16) MyStruct { int x; }; Though it doesn’t use the attribute syntax, alignas(...) is presented as an Attribute for consistency with the [[align(...)]] attribute.

Attribute

An attribute introduced by GNU’s __attribute__((name)) syntax, Microsoft’s __declspec(name) syntax, Microsoft’s [name] syntax, the C++11 standard [[name]] syntax, or the C++11 alignas syntax.

AttributeArgument

An argument to an Attribute. For example the argument “dllimport” on the attribute in the following code: __declspec(dllimport) void myFunction();

Declspec

An attribute introduced by Microsoft’s __declspec(name) syntax. For example the attribute on the following declaration: __declspec(dllimport) void myFunction();

FormatAttribute

A GNU format attribute of the form __attribute__((format(archetype, format-index, first-arg))) that declares a function to accept a printf style format string. For example the attribute on the following declaration: int myPrintf(const char *format, ...) __attribute__((format(printf, 1, 2)));

FunctionSpecifier

A C/C++ function specifier: inline, virtual, or explicit.

GnuAttribute

An attribute introduced by GNU’s __attribute__((name)) syntax, for example: __attribute__((__noreturn__)).

MicrosoftAttribute

An attribute introduced by Microsoft’s “[name]” syntax, for example “[SA_Pre(Deref=1,Access=SA_Read)]”.

Specifier

A C/C++ specifier: friend, auto, register, static, extern, mutable, inline, virtual, or explicit.

StdAttribute

An attribute introduced by the C++11 standard [[name]] syntax, for example: [[clang::fallthrough]].

StorageClassSpecifier

A C/C++ storage class specifier: auto, register, static, extern, or mutable.