summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/anonymous-struct.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-16 17:27:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-16 17:27:08 +0000
commit33aee3934acfa83de7bff57d653113c188a0f148 (patch)
tree4251fb879a875e12662edbe3a951d2764ceb6b90 /clang/test/SemaCXX/anonymous-struct.cpp
parent5f72a04ba7649f28731328463aeb045a171ae8ef (diff)
downloadbcm5719-llvm-33aee3934acfa83de7bff57d653113c188a0f148.tar.gz
bcm5719-llvm-33aee3934acfa83de7bff57d653113c188a0f148.zip
Emit diagnostic error when the field of an anonymous struct is non trivial.
llvm-svn: 111158
Diffstat (limited to 'clang/test/SemaCXX/anonymous-struct.cpp')
-rw-r--r--clang/test/SemaCXX/anonymous-struct.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/anonymous-struct.cpp b/clang/test/SemaCXX/anonymous-struct.cpp
new file mode 100644
index 00000000000..dfa284ae8b5
--- /dev/null
+++ b/clang/test/SemaCXX/anonymous-struct.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct S {
+ S(); // expected-note {{because type 'S' has a user-declared constructor}}
+};
+
+struct E {
+ struct {
+ S x; // expected-error {{anonymous struct member 'x' has a non-trivial constructor}}
+ };
+};
OpenPOWER on IntegriCloud