[clang] [SemaCXX] Make __builtin_addressof more like std::addressof (PR #78035)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 8 19:00:38 PST 2024
================
@@ -39,7 +39,43 @@ namespace addressof {
struct U { int n : 5; } u;
int *pbf = __builtin_addressof(u.n); // expected-error {{address of bit-field requested}}
- S *ptmp = __builtin_addressof(S{}); // expected-error {{taking the address of a temporary}} expected-warning {{temporary whose address is used as value of local variable 'ptmp' will be destroyed at the end of the full-expression}}
----------------
shafik wrote:
Do we understand why we lost the `warning` diagnostic?
https://github.com/llvm/llvm-project/pull/78035
More information about the cfe-commits
mailing list