================
@@ -102,3 +102,54 @@ void foo() {
f<int>(0); // expected-note {{in instantiation of function template
specialization 'GH26612::f<int>' requested here}}
}
} // namespace GH26612
+
+namespace GH194289 {
+template<int qux>
+void bar() { // expected-note {{'bar' declared here}} expected-note {{possible
target for call}}
+ int foo = (int *) __builtin_assume_aligned(baz, qux + 1);
+ // expected-error@-1 {{use of undeclared identifier 'baz'; did you mean
'bar'?}}
+ // expected-error@-2 {{reference to overloaded function could not be
resolved}}
+ // expected-error@-3 {{cannot initialize a variable of type 'int'}}
----------------
ChenMiaoi wrote:
`int foo = (int *) __builtin_assume_aligned(baz, qux + 1);` introduces an
unrelated initialization error. I think the example below is sufficient:
``` cc
template <int qux>
void bar() {
(void)__builtin_assume_aligned(baz, qux + 1);
}
```
https://github.com/llvm/llvm-project/pull/233112
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits