summaryrefslogtreecommitdiff
path: root/test/CXX/class.access
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2013-10-19 00:05:00 +0000
committerKaelyn Uhrain <rikka@google.com>2013-10-19 00:05:00 +0000
commitb5c7768a74936d4e2c7a484570a638cb74702d8b (patch)
tree69e96d3f123bfb20f5f89968fa967db8d7c59bbc /test/CXX/class.access
parent6e4f6f865010649bc3969e57436b5501544a0c39 (diff)
downloadclang-b5c7768a74936d4e2c7a484570a638cb74702d8b.tar.gz
Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.
Now that CorrectTypo knows how to correctly search classes for typo correction candidates, there is no good reason to only replace an existing CXXScopeSpecifier if it refers to a namespace. While the actual enablement was a matter of changing a single comparison, the fallout from enabling the functionality required a lot more code changes (including my two previous commits). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/class.access')
-rw-r--r--test/CXX/class.access/class.friend/p1.cpp24
-rw-r--r--test/CXX/class.access/p6.cpp4
2 files changed, 14 insertions, 14 deletions
diff --git a/test/CXX/class.access/class.friend/p1.cpp b/test/CXX/class.access/class.friend/p1.cpp
index 1a519dcc3e..4a681629ee 100644
--- a/test/CXX/class.access/class.friend/p1.cpp
+++ b/test/CXX/class.access/class.friend/p1.cpp
@@ -7,8 +7,8 @@
// special access rights to the friends, but they do not make the nominated
// friends members of the befriending class.
-struct S { static void f(); };
-S* g() { return 0; }
+struct S { static void f(); }; // expected-note 2 {{'S' declared here}}
+S* g() { return 0; } // expected-note 2 {{'g' declared here}}
struct X {
friend struct S;
@@ -19,8 +19,8 @@ void test1() {
S s;
g()->f();
S::f();
- X::g(); // expected-error{{no member named 'g' in 'X'}}
- X::S x_s; // expected-error{{no type named 'S' in 'X'}}
+ X::g(); // expected-error{{no member named 'g' in 'X'; did you mean simply 'g'?}}
+ X::S x_s; // expected-error{{no type named 'S' in 'X'; did you mean simply 'S'?}}
X x;
x.g(); // expected-error{{no member named 'g' in 'X'}}
}
@@ -36,24 +36,24 @@ namespace N {
friend struct S2* g2();
};
- struct S2 { static void f2(); };
- S2* g2() { return 0; }
+ struct S2 { static void f2(); }; // expected-note 2 {{'S2' declared here}}
+ S2* g2() { return 0; } // expected-note 2 {{'g2' declared here}}
void test() {
g()->f();
S s;
S::f();
- X::g(); // expected-error{{no member named 'g' in 'N::X'}}
- X::S x_s; // expected-error{{no type named 'S' in 'N::X'}}
+ X::g(); // expected-error{{no member named 'g' in 'N::X'; did you mean simply 'g'?}}
+ X::S x_s; // expected-error{{no type named 'S' in 'N::X'; did you mean simply 'S'?}}
X x;
x.g(); // expected-error{{no member named 'g' in 'N::X'}}
g2();
S2 s2;
- ::g2(); // expected-error{{no member named 'g2' in the global namespace}}
- ::S2 g_s2; // expected-error{{no type named 'S2' in the global namespace}}
- X::g2(); // expected-error{{no member named 'g2' in 'N::X'}}
- X::S2 x_s2; // expected-error{{no type named 'S2' in 'N::X'}}
+ ::g2(); // expected-error{{no member named 'g2' in the global namespace; did you mean simply 'g2'?}}
+ ::S2 g_s2; // expected-error{{no type named 'S2' in the global namespace; did you mean simply 'S2'?}}
+ X::g2(); // expected-error{{no member named 'g2' in 'N::X'; did you mean simply 'g2'?}}
+ X::S2 x_s2; // expected-error{{no type named 'S2' in 'N::X'; did you mean simply 'S2'?}}
x.g2(); // expected-error{{no member named 'g2' in 'N::X'}}
}
}
diff --git a/test/CXX/class.access/p6.cpp b/test/CXX/class.access/p6.cpp
index fbdc87b24e..6a93658fc7 100644
--- a/test/CXX/class.access/p6.cpp
+++ b/test/CXX/class.access/p6.cpp
@@ -92,7 +92,7 @@ namespace test3 {
template <class T> class Outer::A<T, typename T::nature> {
public:
- static void foo();
+ static void foo(); // expected-note {{'Outer::A<B, Green>::foo' declared here}}
};
class B {
@@ -102,7 +102,7 @@ namespace test3 {
void test() {
Outer::A<B, Green>::foo();
- Outer::A<B, Blue>::foo(); // expected-error {{no member named 'foo'}}
+ Outer::A<B, Blue>::foo(); // expected-error {{no member named 'foo' in 'test3::Outer::A<test3::B, test3::Blue>'; did you mean 'Outer::A<B, Green>::foo'?}}
}
}