diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-18 16:10:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-18 16:10:52 +0000 |
commit | d6a49bb69fadcb04119433278c808797a87d2d31 (patch) | |
tree | 100ca1919bac1d488b62bb25f1cd9d5ffd43960e /test/SemaCXX/warn-using-namespace-in-header.cpp | |
parent | 7693b1021862ea04f522cca9ca1df67bd1d2d54e (diff) |
Add an opt-in -Wheader-hygiene, which current diagnoses the use of
global using directives in C++ headers, from Elliot Glaysher!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-using-namespace-in-header.cpp')
-rw-r--r-- | test/SemaCXX/warn-using-namespace-in-header.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-using-namespace-in-header.cpp b/test/SemaCXX/warn-using-namespace-in-header.cpp new file mode 100644 index 0000000000..393e097df5 --- /dev/null +++ b/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}} |