diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
commit | 4ba675006b5a8edfc48b6a9bd3dcf54a70cc08f2 (patch) | |
tree | 48b44512b5db8ced345df4a1a56b5065cf2a14d9 /test/SemaTemplate/instantiate-function-2.cpp | |
parent | d7279c4c177bca357ef96ff1379fd9bc420bfe83 (diff) |
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}} + } +} |