diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-16 17:27:08 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-16 17:27:08 +0000 |
commit | dd7744d01e513e941f47893b16dfebae2c1c9911 (patch) | |
tree | 8d626aeaee3def07fd14fca8591084e925bd98f1 /test/SemaCXX/anonymous-struct.cpp | |
parent | c4421e966d77a18f815284175b3fcbb46f36fa39 (diff) |
Emit diagnostic error when the field of an anonymous struct is non trivial.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/anonymous-struct.cpp')
-rw-r--r-- | test/SemaCXX/anonymous-struct.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/anonymous-struct.cpp b/test/SemaCXX/anonymous-struct.cpp new file mode 100644 index 0000000000..dfa284ae8b --- /dev/null +++ b/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}} + }; +}; |