OSDN Git Service

eca6c5012144f0c5f3337b91be09f59d4ba5158f
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / using1.C
1 // Copyright (C) 2001 Free Software Foundation, Inc.
2 // Contributed by Nathan Sidwell 26 Feb 2001 <nathan@codesourcery.com>
3
4 // Bug 1981. using declarations in namespace scope were not remembered.
5
6 namespace A
7 {
8   void swap () {}
9 };
10
11 template <class T> void f()
12 {
13   using A::swap;
14 }
15
16 template void f<float> ();
17
18 namespace B
19 {
20   int foo (int) { return 1;}
21   
22   template <class T> int baz ()
23   {
24     using ::foo;
25     
26     return foo (1);
27   }
28   template int baz<float> ();
29 };
30
31 int foo (int) { return 0;}
32
33 int main ()
34 {
35   return B::baz<float> ();
36 }