// RUN: %clang_cc1 -fsyntax-only -Wheader-hygiene -verify %s
using namespace warn_in_header_in_global_context; // expected-warning {{using namespace directive in global context in header}}
// While we want to error on the previous using directive, we don't when we are
// inside a namespace
// We should warn in toplevel extern contexts.
extern "C++"
// This is really silly, but we should warn on it:
extern "C++"
// But we shouldn't warn in extern contexts inside namespaces.
// We also shouldn't warn in case of functions.
inline void
// |using namespace| through a macro should warn if the instantiation is in a
// header.
USING_MACRO // expected-warning {{using namespace directive in global context in header}}
using namespace dont_warn;
// |using namespace| through a macro shouldn't warn if the instantiation is in a
// cc file.
// Check behavior of line markers.
# 1 "XXX.h" 1
using namespace warn_header_with_line_marker; // expected-warning {{using namespace directive in global context in header}}
# 70 "warn-using-namespace-in-header.cpp" 2
using namespace nowarn_after_line_marker;