aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/class.access/class.protected/p1.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-09-03 04:56:05 +0000
committerJohn McCall <rjmccall@apple.com>2010-09-03 04:56:05 +0000
commitfe24e05a87e48fa3318b65d1a92c542107639fd9 (patch)
tree5afaecfcdd231fc82120cf2ae7ec56ee8a5187d0 /test/CXX/class.access/class.protected/p1.cpp
parentfae962200efef618d1c24c14b9c3fed25876f059 (diff)
Add a quick-and-dirty hack to give a better diagnostic for [class.protected]
restrictions. The note's not really on the right place given its wording, but putting a second note on the call site (or muddying the wording) doesn't appeal. There are corner cases where this can be wrong, but I'm not concerned. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/class.access/class.protected/p1.cpp')
-rw-r--r--test/CXX/class.access/class.protected/p1.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/CXX/class.access/class.protected/p1.cpp b/test/CXX/class.access/class.protected/p1.cpp
index ab7a7dce3c..8698fb1da8 100644
--- a/test/CXX/class.access/class.protected/p1.cpp
+++ b/test/CXX/class.access/class.protected/p1.cpp
@@ -68,7 +68,7 @@ namespace test1 {
namespace test2 {
class A {
- protected: int x; // expected-note 3 {{declared}}
+ protected: int x; // expected-note 3 {{object type must derive}}
static int sx;
static void test(A&);
};
@@ -103,7 +103,7 @@ namespace test2 {
namespace test3 {
class B;
class A {
- protected: int x; // expected-note {{declared}}
+ protected: int x; // expected-note {{object type must derive}}
static int sx;
static void test(B&);
};
@@ -138,7 +138,7 @@ namespace test3 {
namespace test4 {
class C;
class A {
- protected: int x; // expected-note 3 {{declared}}
+ protected: int x; // expected-note {{declared}} expected-note 2 {{object type must derive}}
static int sx; // expected-note 3{{member is declared here}}
static void test(C&);
};
@@ -215,7 +215,7 @@ namespace test6 {
class Static {};
class A {
protected:
- void foo(int); // expected-note 3 {{declared}}
+ void foo(int); // expected-note 3 {{object type must derive}}
void foo(long);
static void foo(Static);
@@ -253,7 +253,7 @@ namespace test7 {
class Static {};
class A {
protected:
- void foo(int); // expected-note 3 {{declared}}
+ void foo(int); // expected-note 3 {{object type must derive}}
void foo(long);
static void foo(Static);
@@ -291,7 +291,7 @@ namespace test8 {
class Static {};
class A {
protected:
- void foo(int); // expected-note 3 {{declared}}
+ void foo(int); // expected-note 3 {{object type must derive}}
void foo(long);
static void foo(Static);
@@ -329,7 +329,7 @@ namespace test8 {
namespace test9 {
class A { // expected-note {{member is declared here}}
- protected: int foo(); // expected-note 7 {{declared}}
+ protected: int foo(); // expected-note 4 {{declared}} expected-note 2 {{object type must derive}} expected-note {{object type 'test9::A' must derive}}
};
class B : public A { // expected-note {{member is declared here}}