summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/using-directive.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/SemaCXX/using-directive.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/SemaCXX/using-directive.cpp')
-rw-r--r--clang/test/SemaCXX/using-directive.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/using-directive.cpp b/clang/test/SemaCXX/using-directive.cpp
index 0d5c8400ab7..162f7fa07a3 100644
--- a/clang/test/SemaCXX/using-directive.cpp
+++ b/clang/test/SemaCXX/using-directive.cpp
@@ -121,3 +121,8 @@ extern "C++" {
}
void f4() { f2(1); }
+
+// PR7517
+using namespace std; // expected-warning{{using directive refers to implicitly-defined namespace 'std'}}
+using namespace ::std; // expected-warning{{using directive refers to implicitly-defined namespace 'std'}}
+
OpenPOWER on IntegriCloud