aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/warn-using-namespace-in-header.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-03-18 16:10:52 +0000
committerDouglas Gregor <dgregor@apple.com>2011-03-18 16:10:52 +0000
commit96a4bddefbfc52d9612cbdaea535e394ca6f765b (patch)
treecd01b0a32ba1da68d919cb0ae337f8862309b5b4 /clang/test/SemaCXX/warn-using-namespace-in-header.cpp
parent6b314b3d9456f5aa71f0a41d07f92f8c368cb182 (diff)
downloadllvm-96a4bddefbfc52d9612cbdaea535e394ca6f765b.zip
llvm-96a4bddefbfc52d9612cbdaea535e394ca6f765b.tar.gz
llvm-96a4bddefbfc52d9612cbdaea535e394ca6f765b.tar.bz2
Add an opt-in -Wheader-hygiene, which current diagnoses the use of
global using directives in C++ headers, from Elliot Glaysher! llvm-svn: 127881
Diffstat (limited to 'clang/test/SemaCXX/warn-using-namespace-in-header.cpp')
-rw-r--r--clang/test/SemaCXX/warn-using-namespace-in-header.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-using-namespace-in-header.cpp b/clang/test/SemaCXX/warn-using-namespace-in-header.cpp
new file mode 100644
index 0000000..393e097
--- /dev/null
+++ b/clang/test/SemaCXX/warn-using-namespace-in-header.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -Wheader-hygiene -verify %s
+
+#include "warn-using-namespace-in-header.h"
+
+namespace dont_warn {}
+using namespace dont_warn;
+
+// Warning is actually in the header but only the cpp file gets scanned.
+// expected-warning {{using namespace directive in global context in header}}