| 1 |
// { dg-do compile } |
| 2 |
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org> |
| 3 |
// DR101: Redeclaration of extern "C" names via using-declarations |
| 4 |
|
| 5 |
namespace Test1 { |
| 6 |
|
| 7 |
typedef unsigned int X; |
| 8 |
extern "C" void f1(); |
| 9 |
namespace N { |
| 10 |
typedef unsigned int X; |
| 11 |
extern "C" void f1(); |
| 12 |
} |
| 13 |
using N::f1; // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" } |
| 14 |
using N::X; // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" } |
| 15 |
} |
| 16 |
|
| 17 |
|
| 18 |
namespace Test2 { |
| 19 |
|
| 20 |
typedef unsigned int X; // { dg-bogus "X" } |
| 21 |
extern "C" int f2(); |
| 22 |
namespace N { |
| 23 |
typedef unsigned int X; // { dg-bogus "X" } |
| 24 |
extern "C" int f2(); |
| 25 |
} |
| 26 |
using namespace N; |
| 27 |
int i = f2(); // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" } |
| 28 |
X x; // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" } |
| 29 |
|
| 30 |
} |