1 // PR c++/77549 2 // { dg-do compile } 3 4 struct A 5 { 6 static int x; 7 }; 8 9 void f1()10f1 () 11 { 12 using ::A; 13 x; // { dg-error "'x' was not declared in this scope" } 14 } 15 16 namespace N 17 { 18 int bar; 19 } 20 21 void f2()22f2 () 23 { 24 using N::bar; 25 baz++; // { dg-error "'baz' was not declared in this scope; did you mean 'bar'\\?" } 26 } 27 28 int bar()29bar () 30 { 31 return 0; 32 } 33 34 namespace M 35 { 36 int bar()37 bar () 38 { 39 return 0; 40 } 41 } 42 43 void f3()44f3 () 45 { 46 using M::bar; 47 baz (); // { dg-error "'baz' was not declared in this scope; did you mean 'bar'\\?" } 48 } 49 50 namespace O 51 { 52 int foo()53 foo () 54 { 55 return 0; 56 } 57 } 58 59 namespace P 60 { 61 int bar()62 bar () 63 { 64 return 0; 65 } 66 } 67 68 void f4()69f4 () 70 { 71 using O::foo; 72 using P::bar; 73 fooo (); // { dg-error "'fooo' was not declared in this scope; did you mean 'foo'\\?" } 74 baz (); // { dg-error "'baz' was not declared in this scope; did you mean 'bar'\\?" } 75 } 76