summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-11 18:03:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-11 18:03:45 +0000
commit4c7b490d1921dd93685be9da9033101f99997025 (patch)
treeab69b686bce589eac731037b580141a65bc6ef89 /clang/test
parentc6b4017ce2b1e71e75b4ac819cf6ae195f04f73a (diff)
downloadbcm5719-llvm-4c7b490d1921dd93685be9da9033101f99997025.tar.gz
bcm5719-llvm-4c7b490d1921dd93685be9da9033101f99997025.zip
Make sure to try instantiating a templated type which is used in an _Atomic
before complaining that it's incomplete. llvm-svn: 150308
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/atomic-type.c2
-rw-r--r--clang/test/SemaCXX/atomic-type.cxx12
2 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/Sema/atomic-type.c b/clang/test/Sema/atomic-type.c
index 8e725403ae9..a4ac5521091 100644
--- a/clang/test/Sema/atomic-type.c
+++ b/clang/test/Sema/atomic-type.c
@@ -16,7 +16,7 @@ extern _Atomic(int (*)(int(*)[10], int(*)[])) mergetest;
extern _Atomic(int (*)(int(*)[10], int(*)[10])) mergetest;
_Atomic(int()) error1; // expected-error {{_Atomic cannot be applied to function type}}
-_Atomic(struct ErrorS) error2; // expected-error {{_Atomic cannot be applied to incomplete type}}
+_Atomic(struct ErrorS) error2; // expected-error {{_Atomic cannot be applied to incomplete type}} expected-note {{forward declaration}}
_Atomic(int[10]) error3; // expected-error {{_Atomic cannot be applied to array type}}
_Atomic(const int) error4; // expected-error {{_Atomic cannot be applied to qualified type}}
_Atomic(_Atomic(int)) error5; // expected-error {{_Atomic cannot be applied to atomic type}}
diff --git a/clang/test/SemaCXX/atomic-type.cxx b/clang/test/SemaCXX/atomic-type.cxx
new file mode 100644
index 00000000000..adaff2a0a2f
--- /dev/null
+++ b/clang/test/SemaCXX/atomic-type.cxx
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -verify %s
+
+template<typename T> struct atomic {
+ _Atomic(T) value;
+};
+
+template<typename T> struct user {
+ struct inner { char n[sizeof(T)]; };
+ atomic<inner> i;
+};
+
+user<int> u;
OpenPOWER on IntegriCloud