| 1 |
// { dg-do run } |
| 2 |
// Copyright (C) 2001, 2002 Free Software Foundation, Inc. |
| 3 |
// Contributed by Nathan Sidwell 26 Feb 2001 <[email protected]> |
| 4 |
|
| 5 |
// Bug 1981. using declarations in namespace scope were not remembered. |
| 6 |
|
| 7 |
namespace A |
| 8 |
{ |
| 9 |
void swap () {} |
| 10 |
} |
| 11 |
|
| 12 |
template <class T> void f() |
| 13 |
{ |
| 14 |
using A::swap; |
| 15 |
} |
| 16 |
|
| 17 |
template void f<float> (); |
| 18 |
|
| 19 |
int foo (int) { return 0;} |
| 20 |
|
| 21 |
namespace B |
| 22 |
{ |
| 23 |
int foo (int) { return 1;} |
| 24 |
|
| 25 |
template <class T> int baz () |
| 26 |
{ |
| 27 |
using ::foo; |
| 28 |
|
| 29 |
return foo (1); |
| 30 |
} |
| 31 |
template int baz<float> (); |
| 32 |
} |
| 33 |
|
| 34 |
int main () |
| 35 |
{ |
| 36 |
return B::baz<float> (); |
| 37 |
} |