mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 19:23:33 +08:00
0b66f31738
* cp-valprint.c (cp_print_value_fields): Replaced obstack_base() method of popping recursion-detection stack with a method based on obstack_object_size(). * gdb.cp/Makefile.in (EXECUTABLES): Added pr9167. * gdb.cp/pr9167.cc: New file. * gdb.cp/pr9167.exp: New file.
37 lines
536 B
C++
37 lines
536 B
C++
#include <iostream>
|
|
|
|
template<typename DATA>
|
|
struct ATB
|
|
{
|
|
int data;
|
|
ATB() : data(0) {}
|
|
};
|
|
|
|
|
|
template<typename DATA,
|
|
typename DerivedType >
|
|
class A : public ATB<DATA>
|
|
{
|
|
public:
|
|
static DerivedType const DEFAULT_INSTANCE;
|
|
};
|
|
|
|
template<typename DATA, typename DerivedType>
|
|
const DerivedType A<DATA, DerivedType>::DEFAULT_INSTANCE;
|
|
|
|
class B : public A<int, B>
|
|
{
|
|
|
|
};
|
|
|
|
int main()
|
|
{
|
|
B b;
|
|
// If this if-block is removed then GDB shall
|
|
// not infinitely recurse when trying to print b.
|
|
|
|
return 0; // marker
|
|
}
|
|
|
|
|