]> granicus.if.org Git - clang/commitdiff
Add test for anonymous struct containing an implicitly private data member.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 13 Apr 2017 21:51:04 +0000 (21:51 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 13 Apr 2017 21:51:04 +0000 (21:51 +0000)
Patch by Jacob Young!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300266 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/anonymous-struct.cpp

index b584f89ff447ad48adc7caf2425f4180c9d25831..bb7e6eb92da308f1fac4cf8460ea21e6a628fd9d 100644 (file)
@@ -21,6 +21,9 @@ struct E {
   };
   static struct {
   };
+  class {
+    int anon_priv_field; // expected-error {{anonymous struct cannot contain a private data member}}
+  };
 };
 
 template <class T> void foo(T);