summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/friend10.C
blob: 935b2fe5bdc0bd85b3acab9f9cd61a5509b0a3d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// { dg-do assemble  }
// Origin: Neil Booth, from PR #78

namespace MySpace
 {
   class Tag1 { };
   class Tag2 { };

   template<class Tag>
   class Object
   {
   public:

     friend void Forgotten(Object const & m) {}
   };

   typedef Object<Tag1> U1;
   typedef Object<Tag2> U2;

   void foo()
   {
     Forgotten(U1());
     Forgotten(U2());
   }

   void bar()
   {
     Forgotten(U1());
   }
 }