view gcc/testsuite/g++.dg/template/vtable2.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

// Use a small template instantiation depth to speed up testing 
// { dg-options "-ftemplate-depth-5" }
// { dg-do compile }

// Origin: rullo.pat@tiscalinet.it
//	   Nathanael Nerode <neroden@gcc.gnu.org>
//	   Wolfgang Bangerth <bangerth@dealii.org>

// PR c++/6749: Infinite loop generating vtable.

template <class T> struct inner {};

template <class T> struct parent {
  virtual void f()			// { dg-error "depth" }
    { parent<inner<T> > p; };
};

template struct parent<int>;

// { dg-prune-output "compilation terminated" }