summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt/typo.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-29 17:53:46 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-29 17:53:46 +0000
commitcdf87024edb7d178cf8878f0f55f02fd2dab24b6 (patch)
treeec491f4f3caaac0d102a320705ec6b8d15716f56 /clang/test/FixIt/typo.cpp
parent049f4ffab16e05ef0e7ca6aa380b7b415a8e823b (diff)
downloadbcm5719-llvm-cdf87024edb7d178cf8878f0f55f02fd2dab24b6.tar.gz
bcm5719-llvm-cdf87024edb7d178cf8878f0f55f02fd2dab24b6.zip
Allow a using directive to refer to the implicitly-defined namespace
"std", with a warning, to improve GCC compatibility. Fixes PR7517. As a drive-by, add typo correction for using directives. llvm-svn: 107172
Diffstat (limited to 'clang/test/FixIt/typo.cpp')
-rw-r--r--clang/test/FixIt/typo.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/FixIt/typo.cpp b/clang/test/FixIt/typo.cpp
index 5b9e68bbfd3..9789a5807a6 100644
--- a/clang/test/FixIt/typo.cpp
+++ b/clang/test/FixIt/typo.cpp
@@ -12,7 +12,8 @@ namespace std {
typedef basic_string<char> string; // expected-note 2{{'string' declared here}}
}
-namespace otherstd { // expected-note 2{{'otherstd' declared here}}
+namespace otherstd { // expected-note 2{{'otherstd' declared here}} \
+ // expected-note{{namespace 'otherstd' defined here}}
using namespace std;
}
@@ -29,6 +30,10 @@ float area(float radius, // expected-note{{'radius' declared here}}
return radious * pi; // expected-error{{did you mean 'radius'?}}
}
+using namespace othestd; // expected-error{{no namespace named 'othestd'; did you mean 'otherstd'?}}
+namespace blargh = otherstd; // expected-note{{namespace 'blargh' defined here}}
+using namespace ::blarg; // expected-error{{no namespace named 'blarg' in the global namespace; did you mean 'blargh'?}}
+
bool test_string(std::string s) {
basc_string<char> b1; // expected-error{{no template named 'basc_string'; did you mean 'basic_string'?}}
std::basic_sting<char> b2; // expected-error{{no template named 'basic_sting' in namespace 'std'; did you mean 'basic_string'?}}
OpenPOWER on IntegriCloud