| 1 |
// { dg-do assemble { target c++17_down } } |
| 2 |
// { dg-options "-O1" } |
| 3 |
// Origin: Jakub Jelinek <[email protected]> |
| 4 |
|
| 5 |
class Type; |
| 6 |
template<class E> |
| 7 |
class X |
| 8 |
{ |
| 9 |
public: |
| 10 |
X<E>(); |
| 11 |
inline X<E>(int); |
| 12 |
inline ~X<E>(); |
| 13 |
}; |
| 14 |
template<class E> const Type &foo(const X<E> *); |
| 15 |
template<class E> inline X<E>::X(int x) |
| 16 |
{ |
| 17 |
const Type &a = foo(this); |
| 18 |
} |
| 19 |
template<class E> inline X<E>::~X() |
| 20 |
{ |
| 21 |
const Type &a = foo(this); |
| 22 |
} |
| 23 |
class Y |
| 24 |
{ |
| 25 |
X<Type> a; |
| 26 |
public: |
| 27 |
Y(const X<Type> &x = X<Type>()); |
| 28 |
}; |
| 29 |
Y::Y(const X<Type> &x) : a(1) |
| 30 |
{ |
| 31 |
} |