| 1 |
// Copyright (C) 2007 Free Software Foundation |
| 2 |
// Contributed by Ollie Wild <[email protected]> |
| 3 |
// { dg-do compile } |
| 4 |
|
| 5 |
namespace M { |
| 6 |
struct S {}; // { dg-message "struct M::S" "candidate 1" } |
| 7 |
} |
| 8 |
|
| 9 |
namespace N { |
| 10 |
int S; |
| 11 |
struct S {}; // { dg-message "struct N::S" "candidate 2" } |
| 12 |
} |
| 13 |
|
| 14 |
using namespace M; |
| 15 |
using namespace N; |
| 16 |
|
| 17 |
struct ::S s; // { dg-bogus "ambiguous.*ambiguous" "duplicate error" } |
| 18 |
// { dg-error "reference to 'S' is ambiguous|invalid type" "" { target *-*-* } .-1 }} |