1 // RUN: %clang_cc1 -std=c++11 %s -fsyntax-only -verify -fms-compatibility -fexceptions -fcxx-exceptions
2 // RUN: %clang_cc1 -std=c++17 %s -fsyntax-only -verify -fms-compatibility -fexceptions -fcxx-exceptions
4 // FIXME: Should -fms-compatibility soften these errors into warnings to match
5 // MSVC? In practice, MSVC never implemented dynamic exception specifiers, so
6 // there isn't much Windows code in the wild that uses them.
7 #if __cplusplus >= 201703L
8 // expected-error@+3 {{ISO C++17 does not allow dynamic exception specifications}}
9 // expected-note@+2 {{use 'noexcept(false)' instead}}
11 void f() throw(...) { }
14 struct S
; // expected-note {{forward declaration}}
15 #if __cplusplus >= 201703L
16 // expected-error@+3 {{ISO C++17 does not allow dynamic exception specifications}}
17 // expected-note@+2 {{use 'noexcept(false)' instead}}
19 void fn() throw(S
); // expected-warning {{incomplete type}} expected-note{{previous declaration}}
20 void fn() throw(); // expected-warning {{does not match previous declaration}}
23 template <typename T
> struct FooPtr
{
24 template <typename U
> FooPtr(U
*p
) : m_pT(nullptr) {}
27 // FIXME: It would be better if this note pointed at the primary template
29 // expected-note@+1 {{previous declaration is here}}
30 FooPtr(T
*pInterface
) throw() // expected-warning {{exception specification in declaration does not match previous declaration}}
36 template struct FooPtr
<Bar
>; // expected-note {{requested here}}