Douglas Gregor | d6a49bb | 2011-03-18 16:10:52 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wheader-hygiene -verify %s |
| 2 | |
| 3 | #include "warn-using-namespace-in-header.h" |
| 4 | |
| 5 | namespace dont_warn {} |
| 6 | using namespace dont_warn; |
| 7 | |
| 8 | // Warning is actually in the header but only the cpp file gets scanned. |
| 9 | // expected-warning {{using namespace directive in global context in header}} |
Douglas Gregor | 9172aa6 | 2011-03-26 22:25:30 +0000 | [diff] [blame] | 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | // Warn inside linkage specs too. |
| 20 | // expected-warning {{using namespace directive in global context in header}} |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | // expected-warning {{using namespace directive in global context in header}} |
Nico Weber | 2166948 | 2011-04-02 19:45:15 +0000 | [diff] [blame] | 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | // expected-warning {{using namespace directive in global context in header}} |
| 51 | |
| 52 | // |using namespace| through a macro shouldn't warn if the instantiation is in a |
| 53 | // cc file. |
| 54 | USING_MACRO |