File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 11 - ` A7-1-2 ` - ` VariableMissingConstexpr.ql ` :
2- - Remove false positives for compiler generated variables
3- - Remove results in uninstantiated templates that cause false positives
2+ - Fixes #607 . Remove false positives for compiler generated variables and in uninstantiated templates
Original file line number Diff line number Diff line change 6767 not v .isFromUninstantiatedTemplate ( _) and
6868 // Exclude compiler generated variables, which are not user controllable
6969 not v .isCompilerGenerated ( )
70- select v , "Variable " + v .getName ( ) + " could be marked 'constexpr'."
70+ select v , "Variable ' " + v .getName ( ) + "' could be marked 'constexpr'."
Original file line number Diff line number Diff line change @@ -266,14 +266,12 @@ constexpr void fp_reported_in_466(int p) {
266266 add4 (1 , l3); // COMPLIANT - l3 is not compile time constant on all paths
267267}
268268
269- template <typename T> T* init (T** t) { }
269+ template <typename T> T * init (T ** t) {}
270270
271- template <typename T> T* init () {
272- T* t = nullptr ; // COMPLIANT - initialized below
273- init (&t); // Init is ignored in uninitialized template
274- return t;
271+ template <typename T> T * init () {
272+ T * t = nullptr ; // COMPLIANT - initialized below
273+ init (&t); // Init is ignored in uninitialized template
274+ return t;
275275}
276276
277- void test_template_instantiation () {
278- int * t = init<int >();
279- }
277+ void test_template_instantiation () { int *t = init<int >(); }
You can’t perform that action at this time.
0 commit comments