dr101.C   [plain text]


// { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR101: Redeclaration of extern "C" names via using-declarations 
// APPLE LOCAL file C++ using lookup 4329536
namespace Test1 {

  typedef unsigned int X;
  extern "C" void f1();
  namespace N {
    typedef unsigned int X;
    extern "C" void f1();
  }
  using N::f1; // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" }
  using N::X;  // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" }
}


namespace Test2 {

  typedef unsigned int X;   // { dg-bogus "X" "" }
  extern "C" int f2();
  namespace N {
    typedef unsigned int X; // { dg-bogus "X" "" }
    extern "C" int f2();
  }
  using namespace N;
  int i = f2(); // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" }
  X x;          // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" }

}