Add a couple more tests for DR372.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 5 Apr 2018 21:49:20 +0000 (21:49 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 5 Apr 2018 21:49:20 +0000 (21:49 +0000)
llvm-svn: 329352

clang/test/CXX/drs/dr3xx.cpp

index 0de2d49..9a5e51a 100644 (file)
@@ -906,6 +906,25 @@ namespace dr372 { // dr372: no
       };
     };
   }
+
+  // FIXME: This is valid: deriving from A gives D access to A::B
+  namespace std_example {
+    class A {
+    protected:
+      struct B {}; // expected-note {{here}}
+    };
+    struct D : A::B, A {}; // expected-error {{protected}}
+  }
+
+  // FIXME: This is valid: deriving from A::B gives access to A::B!
+  namespace badwolf {
+    class A {
+    protected:
+      struct B; // expected-note {{here}}
+    };
+    struct A::B : A {};
+    struct C : A::B {}; // expected-error {{protected}}
+  }
 }
 
 namespace dr373 { // dr373: 5