mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
C++: Add library support for char8_t type.
This commit is contained in:
@@ -376,6 +376,8 @@ private predicate isIntegralType(@builtintype type, int kind) {
|
||||
kind = 43
|
||||
or
|
||||
kind = 44
|
||||
or
|
||||
kind = 51
|
||||
)
|
||||
}
|
||||
|
||||
@@ -993,6 +995,18 @@ class WideCharType extends IntegralType {
|
||||
override string getCanonicalQLClass() { result = "WideCharType" }
|
||||
}
|
||||
|
||||
/**
|
||||
* The C/C++ `char8_t` type. This is available starting with C++20.
|
||||
* ```
|
||||
* char8_t c8;
|
||||
* ```
|
||||
*/
|
||||
class Char8Type extends IntegralType {
|
||||
Char8Type() { builtintypes(underlyingElement(this), _, 51, _, _, _) }
|
||||
|
||||
override string getCanonicalQLClass() { result = "Char8Type" }
|
||||
}
|
||||
|
||||
/**
|
||||
* The C/C++ `char16_t` type. This is available starting with C11 and C++11.
|
||||
* ```
|
||||
|
||||
@@ -74,6 +74,8 @@ abstract class Architecture extends string {
|
||||
or
|
||||
t instanceof WideCharType and result = wideCharSize()
|
||||
or
|
||||
t instanceof Char8Type and result = 8
|
||||
or
|
||||
t instanceof Char16Type and result = 16
|
||||
or
|
||||
t instanceof Char32Type and result = 32
|
||||
|
||||
Reference in New Issue
Block a user