xref: /llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp (revision c6e68daac0fa6e77a89f3ca72f266a528503dd1c)
18fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -fsyntax-only -verify %s
2*c6e68daaSAndy Gibbs // expected-no-diagnostics
36538c930SJohn McCall 
46538c930SJohn McCall // This is basically paraphrased from the standard.
56538c930SJohn McCall 
66538c930SJohn McCall namespace Root {
76538c930SJohn McCall   int i = 0;
86538c930SJohn McCall   void f();
96538c930SJohn McCall }
106538c930SJohn McCall 
116538c930SJohn McCall namespace A {
126538c930SJohn McCall   using namespace Root;
136538c930SJohn McCall }
146538c930SJohn McCall 
156538c930SJohn McCall namespace B {
166538c930SJohn McCall   using namespace Root;
176538c930SJohn McCall }
186538c930SJohn McCall 
196538c930SJohn McCall namespace AB {
206538c930SJohn McCall   using namespace A;
216538c930SJohn McCall   using namespace B;
226538c930SJohn McCall }
236538c930SJohn McCall 
test()246538c930SJohn McCall void test() {
256538c930SJohn McCall   if (AB::i)
266538c930SJohn McCall     AB::f();
276538c930SJohn McCall }
286538c930SJohn McCall 
296538c930SJohn McCall namespace C {
306538c930SJohn McCall   using Root::i;
316538c930SJohn McCall   using Root::f;
326538c930SJohn McCall }
336538c930SJohn McCall 
346538c930SJohn McCall namespace AC {
356538c930SJohn McCall   using namespace A;
366538c930SJohn McCall   using namespace C;
376538c930SJohn McCall }
386538c930SJohn McCall 
test2()396538c930SJohn McCall void test2() {
406538c930SJohn McCall   if (AC::i)
416538c930SJohn McCall     AC::f();
426538c930SJohn McCall }
43