2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.benjamin / tem06.C
blob3233e0e964d5b687a2cbfefe6c15068dfcabe656
1 // { dg-do run  }
2 // 980945 bkoz
3 // test for correct operators at link time
5 /*
6 /tmp/cca211431.o: In function `void blah<foo<int> >(foo<int> const &)':
7 /tmp/cca211431.o(.void gnu.linkonce.t.blah<foo<int> >(foo<int> const &)+0x1e): undefined reference to `void x<int>(int const &)'
8 */
10 template<class T>
11 class foo {
12 public:
13   foo () {}
14   friend void x (const T &) { }
17 void x(const int &);
19 template<class T>
20 void blah (const T &) {
21   T y;
22   x (4);
25 int main () {
26   const foo<int> v;
27   blah (v);
31 fno-exceptions -fno-rtti
33 1.98r1.o:
34 00000000 W __t3foo1Zi
35 00000000 W blah__H1Zt3foo1Zi_RCX01_v
36 00000000 t gcc2_compiled.
37 00000000 T main
38          U x__H1Zi_RCX01_v
40 1.egcs.o:
41 00000000 W __t3foo1Zi
42 00000000 W blah__H1Zt3foo1Zi_RCX01_v
43 00000000 t gcc2_compiled.
44 00000000 T main
45 00000000 W x__FRCi
48 the reason this goes away at -O is because the U or W function is
49 elided completely.