view gcc/testsuite/g++.dg/eh/spec3.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/4381
// Test that exception-specs work properly for classes with virtual bases.

// { dg-do run }

class Base {};

struct A : virtual public Base
{
  A() {}
};

struct B {};

void func()
#if __cplusplus <= 201402L
throw (B,A)			// { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
#endif
{
  throw A();
}

int main(void)
{
  try {	func(); }
  catch (A& a) { }
}