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!

llvm-svn: 300266

clang/test/SemaCXX/anonymous-struct.cpp

index b584f89..bb7e6eb 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);