Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / basic / basic.lookup / basic.lookup.unqual / p14.cpp
blob3c9e3c70334df11d58beb9122edb4cf82e662c15
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 // C++0x [basic.lookup.unqual]p14:
5 // If a variable member of a namespace is defined outside of the
6 // scope of its namespace then any name used in the definition of
7 // the variable member (after the declarator-id) is looked up as if
8 // the definition of the variable member occurred in its namespace.
10 namespace N {
11 struct S {};
12 S i;
13 extern S j;
14 extern S j2;
17 int i = 2;
18 N::S N::j = i;
19 N::S N::j2(i);
21 namespace M {
22 class X { };
23 inline X operator-(int, X);
25 template<typename T>
26 class Y { };
28 typedef Y<float> YFloat;
30 namespace yfloat {
31 YFloat operator-(YFloat, YFloat);
33 using namespace yfloat;
36 using namespace M;
38 namespace M {
40 class Other {
41 void foo(YFloat a, YFloat b);
46 void Other::foo(YFloat a, YFloat b) {
47 YFloat c = a - b;
50 namespace Other {
51 void other_foo();
54 namespace M2 {
55 using namespace Other;
57 extern "C" {
58 namespace MInner {
59 extern "C" {
60 class Bar {
61 void bar();
68 void M2::MInner::Bar::bar() {
69 other_foo();