2011-03-19 00:10:52 +08:00
|
|
|
// 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}}
|
2011-03-27 06:25:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Warn inside linkage specs too.
|
|
|
|
// expected-warning {{using namespace directive in global context in header}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// expected-warning {{using namespace directive in global context in header}}
|
2011-04-03 03:45:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// expected-warning {{using namespace directive in global context in header}}
|
|
|
|
|
|
|
|
// |using namespace| through a macro shouldn't warn if the instantiation is in a
|
|
|
|
// cc file.
|
|
|
|
USING_MACRO
|