| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
// This is basically paraphrased from the standard. |
| 5 |
|
| 6 |
namespace Root { |
| 7 |
int i = 0; |
| 8 |
void f(); |
| 9 |
} |
| 10 |
|
| 11 |
namespace A { |
| 12 |
using namespace Root; |
| 13 |
} |
| 14 |
|
| 15 |
namespace B { |
| 16 |
using namespace Root; |
| 17 |
} |
| 18 |
|
| 19 |
namespace AB { |
| 20 |
using namespace A; |
| 21 |
using namespace B; |
| 22 |
} |
| 23 |
|
| 24 |
void test() { |
| 25 |
if (AB::i) |
| 26 |
AB::f(); |
| 27 |
} |
| 28 |
|
| 29 |
namespace C { |
| 30 |
using Root::i; |
| 31 |
using Root::f; |
| 32 |
} |
| 33 |
|
| 34 |
namespace AC { |
| 35 |
using namespace A; |
| 36 |
using namespace C; |
| 37 |
} |
| 38 |
|
| 39 |
void test2() { |
| 40 |
if (AC::i) |
| 41 |
AC::f(); |
| 42 |
} |