dr101.c

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 32 行

C
32
字号
// { dg-do compile }// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>// DR101: Redeclaration of extern "C" names via using-declarations 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;  extern "C" int f2();  namespace N {    typedef unsigned int 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" { xfail *-*-* } }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?