C++: Support more function types

This commit is contained in:
Jeroen Ketema
2024-01-02 15:13:20 +01:00
parent 671343619f
commit 9c1de5b2b6
9 changed files with 8986 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
class Function extends @function {
string toString() { none() }
}
from Function fun, string name, int kind, int kind_new
where
functions(fun, name, kind) and
if kind = 7 or kind = 8 then kind_new = 0 else kind_new = kind
select fun, name, kind_new

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Support more function types
compatibility: full
functions.rel: run functions.qlo

View File

@@ -885,3 +885,17 @@ class BuiltInFunction extends Function {
} }
private predicate suppressUnusedThis(Function f) { any() } private predicate suppressUnusedThis(Function f) { any() }
/**
* A C++ user-defined literal [N4140 13.5.8].
*/
class UserDefinedLiteral extends Function {
UserDefinedLiteral() { functions(underlyingElement(this), _, 7) }
}
/**
* A C++ deduction guide [N4659 17.9].
*/
class DeductionGuide extends Function {
DeductionGuide() { functions(underlyingElement(this), _, 8) }
}

View File

@@ -356,6 +356,8 @@ case @function.kind of
| 4 = @conversion_function | 4 = @conversion_function
| 5 = @operator | 5 = @operator
| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk | 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk
| 7 = @user_defined_literal
| 8 = @deduction_guide
; ;
*/ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Support more function types
compatibility: backwards