summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/warn-using-namespace-in-header.cpp
blob: 72c25529b40f89ce4e173b3a65bcf5c11a83b3f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// 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}}









// 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}}






















// 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