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

Module Literal

Provides classes for modeling literals in the source code such as 0, 'c' or "string".

Import path

import semmle.code.cpp.exprs.Literal

Imports

Expr

Provides classes modeling C/C++ expressions.

Classes

AggregateLiteral

A C/C++ aggregate literal.

ArrayAggregateLiteral

A C/C++ aggregate literal that initializes an array S s[4] = { s_1, s_2, s_3, s_n };

ArrayOrVectorAggregateLiteral

A C/C++ aggregate literal that initializes an array or a GNU vector type.

CharLiteral

A character literal. For example: char c1 = 'a'; wchar_t c2 = L'b';

ClassAggregateLiteral

A C/C++ aggregate literal that initializes a class, struct, or union. For example: S s = { arg1, arg2, { arg3, arg4 }, arg5 };

HexLiteral

A hexadecimal literal. unsigned int32_t minus2 = 0xfffffffe;

LabelLiteral

A label literal, that is, a use of the ‘&&’ operator to take the address of a label for use in a computed goto statement. This is a non-standard C/C++ extension.

Literal

A C/C++ literal.

OctalLiteral

An octal literal. For example: char esc = 033; Octal literals must always start with the digit 0.

StringLiteral

A string literal. For example: const char *s1 = "abcdef"; const wchar_t *s2 = L"123456";

TextLiteral

A character literal or a string literal.

VectorAggregateLiteral

A C/C++ aggregate literal that initializes a GNU vector type.