diff options
Diffstat (limited to 'test/SemaTemplate/instantiate-function-2.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-function-2.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-function-2.cpp b/test/SemaTemplate/instantiate-function-2.cpp index afca35878444..ebc0ef3a9f96 100644 --- a/test/SemaTemplate/instantiate-function-2.cpp +++ b/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}} + } +} |