r329352 - Add a couple more tests for DR372.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 5 14:49:20 PDT 2018


Author: rsmith
Date: Thu Apr  5 14:49:20 2018
New Revision: 329352

URL: http://llvm.org/viewvc/llvm-project?rev=329352&view=rev
Log:
Add a couple more tests for DR372.

Modified:
    cfe/trunk/test/CXX/drs/dr3xx.cpp

Modified: cfe/trunk/test/CXX/drs/dr3xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr3xx.cpp?rev=329352&r1=329351&r2=329352&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr3xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr3xx.cpp Thu Apr  5 14:49:20 2018
@@ -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




More information about the cfe-commits mailing list