summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2013-06-24 17:49:03 +0000
committerKaelyn Uhrain <rikka@google.com>2013-06-24 17:49:03 +0000
commit52dd02d8ef35221568f9afd79f4b4f7b7f7bfda5 (patch)
tree115c84c48adfca87603cf447e21959de5f7c8e9b /clang/test
parentb761900a12a3628327f183124fb8ad4d3354530d (diff)
downloadbcm5719-llvm-52dd02d8ef35221568f9afd79f4b4f7b7f7bfda5.tar.gz
bcm5719-llvm-52dd02d8ef35221568f9afd79f4b4f7b7f7bfda5.zip
Add the global namespace (the "::" namespace specifier) to the list of
namespaces to try for potential typo corrections. llvm-svn: 184762
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp4
-rw-r--r--clang/test/FixIt/typo.cpp8
-rw-r--r--clang/test/Parser/cxx-using-directive.cpp5
3 files changed, 11 insertions, 6 deletions
diff --git a/clang/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp b/clang/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp
index 3bc485601ca..816cdb08a90 100644
--- a/clang/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp
+++ b/clang/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp
@@ -3,7 +3,7 @@
// Fun things you can do with inline namespaces:
inline namespace X {
- void f1();
+ void f1(); // expected-note {{'::f1' declared here}}
inline namespace Y {
void f2();
@@ -21,7 +21,7 @@ void foo1() {
f1();
::f1();
X::f1();
- Y::f1(); // expected-error {{no member named 'f1' in namespace 'X::Y'}}
+ Y::f1(); // expected-error {{no member named 'f1' in namespace 'X::Y'; did you mean '::f1'?}}
f2();
::f2();
diff --git a/clang/test/FixIt/typo.cpp b/clang/test/FixIt/typo.cpp
index b3568a5bbf7..ea4a97133c2 100644
--- a/clang/test/FixIt/typo.cpp
+++ b/clang/test/FixIt/typo.cpp
@@ -6,7 +6,7 @@
namespace std {
template<typename T> class basic_string { // expected-note 2{{'basic_string' declared here}} \
- // expected-note {{'otherstd::basic_string' declared here}}
+ // expected-note {{'::basic_string' declared here}}
public:
int find(const char *substr); // expected-note{{'find' declared here}}
static const int npos = -1; // expected-note{{'npos' declared here}}
@@ -84,8 +84,12 @@ namespace nonstd {
yarn str4; // expected-error{{unknown type name 'yarn'; did you mean 'nonstd::yarn'?}}
wibble::yarn str5; // expected-error{{no type named 'yarn' in namespace 'otherstd'; did you mean 'nonstd::yarn'?}}
+namespace another {
+ template<typename T> class wide_string {}; // expected-note {{'another::wide_string' declared here}}
+}
int poit() {
- nonstd::basic_string<char> str; // expected-error{{no template named 'basic_string' in namespace 'nonstd'; did you mean 'otherstd::basic_string'?}}
+ nonstd::basic_string<char> str; // expected-error{{no template named 'basic_string' in namespace 'nonstd'; did you mean '::basic_string'?}}
+ nonstd::wide_string<char> str2; // expected-error{{no template named 'wide_string' in namespace 'nonstd'; did you mean 'another::wide_string'?}}
return wibble::narf; // expected-error{{no member named 'narf' in namespace 'otherstd'; did you mean 'nonstd::narf'?}}
}
diff --git a/clang/test/Parser/cxx-using-directive.cpp b/clang/test/Parser/cxx-using-directive.cpp
index 9a1a6de8926..1b8f495b70e 100644
--- a/clang/test/Parser/cxx-using-directive.cpp
+++ b/clang/test/Parser/cxx-using-directive.cpp
@@ -8,7 +8,7 @@ namespace B {
using namespace A ;
}
-namespace C {}
+namespace C {} // expected-note{{namespace '::C' defined here}}
namespace D {
@@ -22,7 +22,8 @@ namespace D {
using namespace C ;
using namespace B::A ; // expected-error{{no namespace named 'A' in namespace 'D::B'; did you mean '::B::A'?}}
using namespace ::B::A ;
- using namespace ::D::C ; // expected-error{{expected namespace name}}
+ using namespace ::D::F ; // expected-error{{expected namespace name}}
+ using namespace ::D::C ; // expected-error{{no namespace named 'C' in namespace 'D'; did you mean '::C'?}}
}
using namespace ! ; // expected-error{{expected namespace name}}
OpenPOWER on IntegriCloud