summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/inline15.C
blob: 43f7f5e3025015147ce3387da95b169b9905cdb7 (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
31
// { dg-do assemble  }
// { dg-options "-O1" }
// Origin: Jakub Jelinek <jakub@redhat.com>

class Type;
template<class E>
class X
{
public:
  X<E>();
  inline X<E>(int);
  inline ~X<E>();
};
template<class E> const Type &foo(const X<E> *);
template<class E> inline X<E>::X(int x)
{
  const Type &a = foo(this);
}
template<class E> inline X<E>::~X()
{
  const Type &a = foo(this);
}
class Y
{
  X<Type> a;
public:
  Y(const X<Type> &x = X<Type>());
};
Y::Y(const X<Type> &x) : a(1)
{
}