From 8aa8da85ca60f2c7d88c47a67a4252bd032d1eb9 Mon Sep 17 00:00:00 2001 From: Kaelyn Uhrain Date: Sat, 19 Oct 2013 00:05:00 +0000 Subject: 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). llvm-svn: 193020 --- clang/test/Parser/cxx-using-directive.cpp | 4 ++-- clang/test/Parser/switch-recovery.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'clang/test/Parser') diff --git a/clang/test/Parser/cxx-using-directive.cpp b/clang/test/Parser/cxx-using-directive.cpp index 76dc22f1530..5efd991c8e7 100644 --- a/clang/test/Parser/cxx-using-directive.cpp +++ b/clang/test/Parser/cxx-using-directive.cpp @@ -4,7 +4,7 @@ class A {}; namespace B { namespace A {} // expected-note{{namespace '::B::A' defined here}} \ - // expected-note{{namespace 'B::A' defined here}} + // expected-note 2{{namespace 'B::A' defined here}} using namespace A ; } @@ -28,7 +28,7 @@ namespace D { using namespace ! ; // expected-error{{expected namespace name}} using namespace A ; // expected-error{{no namespace named 'A'; did you mean 'B::A'?}} -using namespace ::A // expected-error{{expected namespace name}} \ +using namespace ::A // expected-error{{no namespace named 'A' in the global namespace; did you mean 'B::A'?}} \ // expected-error{{expected ';' after namespace name}} B ; diff --git a/clang/test/Parser/switch-recovery.cpp b/clang/test/Parser/switch-recovery.cpp index 84ac0c899e5..63b580202af 100644 --- a/clang/test/Parser/switch-recovery.cpp +++ b/clang/test/Parser/switch-recovery.cpp @@ -95,7 +95,7 @@ int test8( foo x ) { } // Stress test to make sure Clang doesn't crash. -void test9(int x) { +void test9(int x) { // expected-note {{'x' declared here}} switch(x) { case 1: return; 2: case; // expected-error {{expected 'case' keyword before expression}} \ @@ -104,8 +104,8 @@ void test9(int x) { 7: :x; // expected-error {{expected 'case' keyword before expression}} \ expected-error {{expected expression}} 8:: x; // expected-error {{expected ';' after expression}} \ - expected-error {{no member named 'x' in the global namespace}} \ - expected-warning {{expression result unused}} + expected-error {{no member named 'x' in the global namespace; did you mean simply 'x'?}} \ + expected-warning 2 {{expression result unused}} 9:: :y; // expected-error {{expected ';' after expression}} \ expected-error {{expected unqualified-id}} \ expected-warning {{expression result unused}} -- cgit v1.2.3