diff options
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-function-2.cpp')
| -rw-r--r-- | clang/test/SemaTemplate/instantiate-function-2.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-function-2.cpp b/clang/test/SemaTemplate/instantiate-function-2.cpp index afca3587844..ebc0ef3a9f9 100644 --- a/clang/test/SemaTemplate/instantiate-function-2.cpp +++ b/clang/test/SemaTemplate/instantiate-function-2.cpp @@ -20,3 +20,14 @@ namespace PR7184 { template void f<int>(); } + +namespace UsedAttr { + template<typename T> + void __attribute__((used)) foo() { + T *x = 1; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}} + } + + void bar() { + foo<int>(); // expected-note{{instantiation of}} + } +} |

