1 // RUN: %clang_cc1 -fsyntax-only -verify -fcxx-exceptions -std=c++11 %s
3 namespace MissingOnTemplate
{
4 template<typename T
> void foo(T
) noexcept(true); // expected-note {{previous}}
5 template<typename T
> void foo(T
); // expected-error {{missing exception specification 'noexcept(true)'}}
6 void test() { foo(0); }
9 struct UseBeforeComplete1
{
10 ~UseBeforeComplete1(); // expected-note {{previous}}
12 friend UseBeforeComplete1::~UseBeforeComplete1() noexcept
; // expected-warning {{previously declared with an implicit}}
16 struct ThrowingDtor
{ ~ThrowingDtor() noexcept(false); };
17 struct UseBeforeComplete2
{
18 ~UseBeforeComplete2(); // expected-note {{previous}}
20 friend UseBeforeComplete2::~UseBeforeComplete2() noexcept
; // expected-error {{does not match previous}}
25 struct UseBeforeComplete3
{
26 ~UseBeforeComplete3();
28 friend UseBeforeComplete3::~UseBeforeComplete3(); // ok, implicitly noexcept(true)
31 static_assert(noexcept(UseBeforeComplete3()), "");
33 struct UseBeforeComplete4
{
34 ~UseBeforeComplete4();
36 friend UseBeforeComplete4::~UseBeforeComplete4(); // ok, implicitly noexcept(false)
40 static_assert(!noexcept(UseBeforeComplete4()), "");
42 namespace AssignmentOp
{
46 B
&operator=(const B
&);
47 virtual D1
&operator=(const D1
&) noexcept
; // expected-note {{overridden}}
48 virtual D2
&operator=(const D2
&) noexcept
; // expected-note {{overridden}}
50 struct D1
: B
{}; // expected-error {{more lax}}
52 D2
&operator=(const D2
&); // expected-error {{more lax}}