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.h | |
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.h')
-rw-r--r-- | test/SemaCXX/warn-using-namespace-in-header.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-using-namespace-in-header.h b/test/SemaCXX/warn-using-namespace-in-header.h new file mode 100644 index 0000000000..677c4ac51a --- /dev/null +++ b/test/SemaCXX/warn-using-namespace-in-header.h @@ -0,0 +1,15 @@ + + + + + +// Lots of vertical space to make the error line match up with the line of the +// expected line in the source file. +namespace warn_in_header_in_global_context {} +using namespace warn_in_header_in_global_context; + +// While we want to error on the previous using directive, we don't when we are +// inside a namespace +namespace dont_warn_here { +using namespace warn_in_header_in_global_context; +} |