From 4e8e3513a4477ead60fad404859839ef1e1a2582 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 5 Apr 2018 21:49:20 +0000 Subject: [PATCH] Add a couple more tests for DR372. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329352 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CXX/drs/dr3xx.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/CXX/drs/dr3xx.cpp b/test/CXX/drs/dr3xx.cpp index 0de2d495a3..9a5e51a78c 100644 --- a/test/CXX/drs/dr3xx.cpp +++ b/test/CXX/drs/dr3xx.cpp @@ -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 -- 2.40.0