Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
#
fd6baa47 |
| 09-Jan-2025 |
Timm Baeder <tbaeder@redhat.com> |
[clang][ExprConst] Add diagnostics for invalid binary arithmetic (#118475)
... between unrelated declarations or literals.
Leaving this small (I haven't run the whole test suite locally) to get som
[clang][ExprConst] Add diagnostics for invalid binary arithmetic (#118475)
... between unrelated declarations or literals.
Leaving this small (I haven't run the whole test suite locally) to get some feedback on the wording and implementation first.
The output of the sample in https://github.com/llvm/llvm-project/issues/117409 is now: ```console ./array.cpp:57:6: warning: expression result unused [-Wunused-value] 57 | am - aj.af(); | ~~ ^ ~~~~~~~ ./array.cpp:70:8: error: call to consteval function 'L::L<bx>' is not a constant expression 70 | q(0, [] { | ^ ./array.cpp:57:6: note: arithmetic on addresses of literals has unspecified value 57 | am - aj.af(); | ^ ./array.cpp:62:5: note: in call to 'al(&""[0], {&""[0]})' 62 | al(bp.af(), k); | ^~~~~~~~~~~~~~ ./array.cpp:70:8: note: in call to 'L<bx>({})' 70 | q(0, [] { | ^~~~ 71 | struct bx { | ~~~~~~~~~~~ 72 | constexpr operator ab<g<l<decltype(""[0])>::e>::e>() { return t(""); } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | }; | ~~ 74 | return bx(); | ~~~~~~~~~~~~ 75 | }()); | ~~~ ```
The output for ```c++ int a, b; constexpr int n = &b - &a ```
is now: ```console ./array.cpp:80:15: error: constexpr variable 'n' must be initialized by a constant expression 80 | constexpr int n = &b - &a; | ^ ~~~~~~~ ./array.cpp:80:22: note: arithmetic involving '&b' and '&a' has unspecified value 80 | constexpr int n = &b - &a; | ^ 1 error generated.
```
show more ...
|
Revision tags: llvmorg-19.1.6 |
|
#
056cd122 |
| 17-Dec-2024 |
Timm Baeder <tbaeder@redhat.com> |
[clang][bytecode] Don't check returned pointers for liveness (#120107)
We're supposed to let them through and then later diagnose reading from them, but returning dead pointers is fine.
|
Revision tags: llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3 |
|
#
a07aba5d |
| 16-Aug-2024 |
Timm Baeder <tbaeder@redhat.com> |
[clang] Rename all AST/Interp stuff to AST/ByteCode (#104552)
"Interp" clashes with the clang interpreter and people often confuse
this.
|