cxx-throw.cpp 462 B

1234567891011121314151617
  1. // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify %s
  2. int i;
  3. void foo() {
  4. (throw,throw);
  5. (1 ? throw 1 : throw 2);
  6. throw int(1);
  7. throw;
  8. throw 1;
  9. throw;
  10. 1 ? throw : (void)42;
  11. __extension__ throw 1; // expected-error {{expected expression}}
  12. (void)throw; // expected-error {{expected expression}}
  13. }
  14. void f() throw(static); // expected-error {{expected a type}} expected-error {{does not allow storage class}}