binutils-gdb/gdb/testsuite/gdb.cp/pr9167.cc
Chris Moller 0b66f31738 PR 9167
* 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.
2010-04-21 17:33:54 +00:00

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
}