diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-05 21:49:20 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-05 21:49:20 +0000 |
commit | 6cb16ed98fa4ed3ba6f620eb7d6c4eec356c1651 (patch) | |
tree | c2eefaf01e82b5d79ff35cbc7b9854c1b301b629 /clang/test/CXX | |
parent | cdc4077ddfc97bbbf822d28a90fe84a8ec1db27b (diff) |
Add a couple more tests for DR372.
Diffstat (limited to 'clang/test/CXX')
-rw-r--r-- | clang/test/CXX/drs/dr3xx.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CXX/drs/dr3xx.cpp b/clang/test/CXX/drs/dr3xx.cpp index 0de2d495a34..9a5e51a78c7 100644 --- a/clang/test/CXX/drs/dr3xx.cpp +++ b/clang/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 |