================
@@ -48,6 +48,13 @@ namespace addressof {
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}}
+
+ template <typename T> void tmpl(T) {}
+ static_assert(__builtin_addressof(tmpl<int>) == &tmpl<int>, "");
----------------
cor3ntin wrote:
Can you add a test in a dependent context.
Maybe
```cpp
template <typename T>
void f() {
void (*povl)(int) = __builtin_addressof(tmpl<T>);
}
auto _ = (f<int>(), 0);```
https://github.com/llvm/llvm-project/pull/235313
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits