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

Module Element

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

Import path

import semmle.code.cpp.Element

Imports

Location

Provides classes and predicates for locations in the source code.

Predicates

mkElement

Get the Element that represents this @element. Normally this will simply be a cast of e, but sometimes it is not. For example, for an incomplete struct e the result may be a complete struct with the same name.

underlyingElement

INTERNAL: Do not use.

unresolveElement

INTERNAL: Do not use.

Classes

Element

A C/C++ element. This class is the base class for all C/C++ elements, such as functions, classes, expressions, and so on.

ElementBase

A C/C++ element with no member predicates other than toString. Not for general use. This class does not define a location, so classes wanting to change their location without affecting other classes can extend ElementBase instead of Element to create a new rootdef for getURL, getLocation, or hasLocationInfo.

StaticAssert

A C++11 static_assert or C11 _Static_assert construct. For example each line in the following example contains a static assert: static_assert(sizeof(MyStruct) <= 4096); static_assert(sizeof(MyStruct) <= 4096, "MyStruct is too big!");