view gcc/testsuite/g++.old-deja/g++.mike/eh33.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } }
// { dg-require-effective-target c++14_down }
// { dg-options "-fexceptions" }

#include <exception>

void my_unexpected() {
  throw 42;
}

void foo() throw (int) { throw "Hi"; }	// { dg-warning "deprecated" "" { target c++11 } }

int main() {
  std::set_unexpected (my_unexpected);
  try {
    foo();
  } catch (int i) {
    if (i == 42)
      return 0;
  }
  return 1;
}