summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/access.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/access.cpp')
-rw-r--r--test/SemaCXX/access.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/test/SemaCXX/access.cpp b/test/SemaCXX/access.cpp
index 50f2eff..5ccd418 100644
--- a/test/SemaCXX/access.cpp
+++ b/test/SemaCXX/access.cpp
@@ -26,9 +26,11 @@ private:
namespace test1 {
class A {
private:
- class X; // expected-note {{previously declared 'private' here}}
+ class X; // expected-note {{previously declared 'private' here}} \
+ // expected-note {{previous declaration is here}}
public:
- class X; // expected-error {{'X' redeclared with 'public' access}}
+ class X; // expected-error {{'X' redeclared with 'public' access}} \
+ // expected-warning {{class member cannot be redeclared}}
class X {};
};
}
@@ -106,3 +108,31 @@ namespace PR15209 {
}
}
}
+
+namespace PR7434 {
+ namespace comment0 {
+ template <typename T> struct X;
+ namespace N {
+ class Y {
+ template<typename T> friend struct X;
+ int t; // expected-note {{here}}
+ };
+ }
+ template<typename T> struct X {
+ X() { (void)N::Y().t; } // expected-error {{private}}
+ };
+ X<char> x;
+ }
+ namespace comment2 {
+ struct X;
+ namespace N {
+ class Y {
+ friend struct X;
+ int t; // expected-note {{here}}
+ };
+ }
+ struct X {
+ X() { (void)N::Y().t; } // expected-error {{private}}
+ };
+ }
+}
OpenPOWER on IntegriCloud