| 1 |
// Origin: PR 44641 |
| 2 |
// { dg-do compile { target c++17_down } } |
| 3 |
// { dg-options "-gdwarf-2 -O0 -dA" } |
| 4 |
|
| 5 |
template <class A> struct MisplacedDbg; |
| 6 |
template<class T> struct MisplacedDbg<T*>; |
| 7 |
struct Full; |
| 8 |
template<> struct MisplacedDbg<Full>; |
| 9 |
|
| 10 |
struct Arg; |
| 11 |
typedef MisplacedDbg<Arg> Typedef1; |
| 12 |
typedef MisplacedDbg<Arg*> Typedef2; |
| 13 |
typedef MisplacedDbg<Full> Typedef3; |
| 14 |
|
| 15 |
template<typename T> struct Base { |
| 16 |
int i; |
| 17 |
virtual ~Base() { |
| 18 |
} |
| 19 |
}; |
| 20 |
|
| 21 |
template <> |
| 22 |
struct MisplacedDbg<Full> // { dg-function-on-line {_ZN12MisplacedDbgI4FullEC[12]Ev} { xfail powerpc-ibm-aix* } } |
| 23 |
// { dg-function-on-line {_ZN12MisplacedDbgI4FullED0Ev} { target *-*-* xfail powerpc-ibm-aix* } 22 } |
| 24 |
|
| 25 |
: public Base<int> { |
| 26 |
}; |
| 27 |
|
| 28 |
template <class T> |
| 29 |
struct MisplacedDbg<T*> // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgEC[12]Ev} { xfail powerpc-ibm-aix* } } |
| 30 |
// { dg-function-on-line {_ZN12MisplacedDbgIP3ArgED0Ev} { target *-*-* xfail powerpc-ibm-aix* } 29 } |
| 31 |
: public Base<int> { |
| 32 |
}; |
| 33 |
|
| 34 |
template <class A> |
| 35 |
struct MisplacedDbg // { dg-function-on-line {_ZN12MisplacedDbgI3ArgEC[12]Ev} { xfail powerpc-ibm-aix* } } |
| 36 |
// { dg-function-on-line {_ZN12MisplacedDbgI3ArgED0Ev} { target *-*-* xfail powerpc-ibm-aix* } 35 } |
| 37 |
: public Base<int> { |
| 38 |
}; |
| 39 |
|
| 40 |
static MisplacedDbg<Arg> static_var1; |
| 41 |
static MisplacedDbg<Arg*> static_var2; |
| 42 |
static MisplacedDbg<Full> static_var3; |
| 43 |
|
| 44 |
// This test is skipped in C++20 because we consider the default constructor |
| 45 |
// MisplacedDbg() constexpr despite the uninitialized member "int i;". So |
| 46 |
// the calls to |
| 47 |
// MisplacedDbg<Arg>::MisplacedDbg() |
| 48 |
// MisplacedDbg<Full>::MisplacedDbg() |
| 49 |
// MisplacedDbg<Arg*>::MisplacedDbg() |
| 50 |
// are elided. (This comment is here not to mess up the line numbers.) |