diff --git a/cpp/ql/src/semmle/code/cpp/Variable.qll b/cpp/ql/src/semmle/code/cpp/Variable.qll index ee1b41109f4b..6fd33d9a037a 100644 --- a/cpp/ql/src/semmle/code/cpp/Variable.qll +++ b/cpp/ql/src/semmle/code/cpp/Variable.qll @@ -315,7 +315,7 @@ class ParameterDeclarationEntry extends VariableDeclarationEntry { * static int c; * } * ``` - * + * * Local variables can be static; use the `isStatic` member predicate to * detect those. */ @@ -343,7 +343,7 @@ deprecated class StackVariable extends Variable { * static int c; * } * ``` - * + * * Local variables can be static; use the `isStatic` member predicate to detect * those. * @@ -512,9 +512,9 @@ class TemplateVariable extends Variable { * void myTemplateFunction() { * T b; * } - * + * * ... - * + * * myTemplateFunction(); * ``` */ diff --git a/cpp/ql/src/semmle/code/cpp/commons/CommonType.qll b/cpp/ql/src/semmle/code/cpp/commons/CommonType.qll index c4eb0ff1c2a4..f584a8e48027 100644 --- a/cpp/ql/src/semmle/code/cpp/commons/CommonType.qll +++ b/cpp/ql/src/semmle/code/cpp/commons/CommonType.qll @@ -174,9 +174,7 @@ class MicrosoftInt64Type extends IntegralType { * `__builtin_va_copy` and `__builtin_va_arg` expressions. */ class BuiltInVarArgsList extends Type { - BuiltInVarArgsList() { - this.hasName("__builtin_va_list") - } + BuiltInVarArgsList() { this.hasName("__builtin_va_list") } override string getCanonicalQLClass() { result = "BuiltInVarArgsList" } } diff --git a/cpp/upgrades/814fae599505510ff15102f4c72600586734770a/lambda_capture.ql b/cpp/upgrades/814fae599505510ff15102f4c72600586734770a/lambda_capture.ql index dec7d1f7fe51..b9583d649496 100644 --- a/cpp/upgrades/814fae599505510ff15102f4c72600586734770a/lambda_capture.ql +++ b/cpp/upgrades/814fae599505510ff15102f4c72600586734770a/lambda_capture.ql @@ -1,15 +1,28 @@ +class LambdaCapture extends @lambdacapture { + string toString() { none() } +} + +class Lambda extends @lambdaexpr { + string toString() { none() } +} + +class Field extends @membervariable { + string toString() { none() } +} + +class Location extends @location_default { + string toString() { none() } +} -class LambdaCapture extends @lambdacapture { string toString() { none() } } -class Lambda extends @lambdaexpr { string toString() { none() } } -class Field extends @membervariable { string toString() { none() } } -class Location extends @location_default { string toString() { none() } } -class Type extends @usertype { string toString() { none() } } +class Type extends @usertype { + string toString() { none() } +} pragma[noopt] -predicate lambda_capture_new(LambdaCapture lc, Lambda l, int i, Field f, - boolean captured_by_reference, boolean is_implicit, - Location loc) -{ +predicate lambda_capture_new( + LambdaCapture lc, Lambda l, int i, Field f, boolean captured_by_reference, boolean is_implicit, + Location loc +) { exists(Type t | lambda_capture(lc, l, i, captured_by_reference, is_implicit, loc) and expr_types(l, t, _) and @@ -19,8 +32,8 @@ predicate lambda_capture_new(LambdaCapture lc, Lambda l, int i, Field f, ) } -from LambdaCapture lc, Lambda l, int i, Field f, - boolean captured_by_reference, boolean is_implicit, - Location loc +from + LambdaCapture lc, Lambda l, int i, Field f, boolean captured_by_reference, boolean is_implicit, + Location loc where lambda_capture_new(lc, l, i, f, captured_by_reference, is_implicit, loc) select lc, l, i, f, captured_by_reference, is_implicit, loc diff --git a/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/values.ql b/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/values.ql index 18fdcba7f43f..2746b1314ff9 100644 --- a/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/values.ql +++ b/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/values.ql @@ -1,7 +1,7 @@ - -class Value extends @value { string toString() { none() } } +class Value extends @value { + string toString() { none() } +} from Value v, string s where values(v, s, _) select v, s - diff --git a/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/valuetext.ql b/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/valuetext.ql index 1374936c08b7..c0a02112a4dd 100644 --- a/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/valuetext.ql +++ b/cpp/upgrades/cac7e92107084af19112986145f72b8de646c39d/valuetext.ql @@ -1,7 +1,7 @@ - -class Value extends @value { string toString() { none() } } +class Value extends @value { + string toString() { none() } +} from Value v, string s where values(v, _, s) select v, s -