From d6a49bb69fadcb04119433278c808797a87d2d31 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 18 Mar 2011 16:10:52 +0000 Subject: 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 --- test/SemaCXX/warn-using-namespace-in-header.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/SemaCXX/warn-using-namespace-in-header.cpp (limited to 'test/SemaCXX/warn-using-namespace-in-header.cpp') 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}} -- cgit v1.2.3-70-g09d2