Commit e5b16e1
committed
Fix #11538: Fix syntax error on C++23 'if consteval' / 'if !consteval'
The tokenizer only recognized 'if constexpr (...)' and treated any
other 'if <name>' without parentheses as a syntax error, so C++23's
'if consteval { ... }' and 'if !consteval { ... }' were rejected.
Rewrite them to 'if ( __cppcheck_consteval__ ) { ... }' and
'if ( ! __cppcheck_consteval__ ) { ... }' respectively, using a
synthetic unresolved symbol rather than a boolean literal so that
valueflow can't treat the condition as always true/false.1 parent 3deb36d commit e5b16e1
2 files changed
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5721 | 5721 | | |
5722 | 5722 | | |
5723 | 5723 | | |
5724 | | - | |
| 5724 | + | |
| 5725 | + | |
| 5726 | + | |
| 5727 | + | |
| 5728 | + | |
| 5729 | + | |
| 5730 | + | |
| 5731 | + | |
| 5732 | + | |
| 5733 | + | |
| 5734 | + | |
| 5735 | + | |
| 5736 | + | |
| 5737 | + | |
| 5738 | + | |
| 5739 | + | |
5725 | 5740 | | |
5726 | 5741 | | |
5727 | 5742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
1042 | 1043 | | |
1043 | 1044 | | |
1044 | 1045 | | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
1045 | 1062 | | |
1046 | 1063 | | |
1047 | 1064 | | |
| |||
0 commit comments