18 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -verify %s2 3// The exception specification of a destructor declaration is matched *before*4// the exception specification adjustment occurs.5namespace DR1492 {6 struct A { ~A(); }; // expected-note {{here}}7 A::~A() noexcept {} // expected-warning {{previously declared with an implicit exception specification}}8 9 struct B { ~B() noexcept; }; // expected-note {{here}}10 B::~B() {} // expected-warning {{previously declared with an explicit exception specification}}11 12 template<typename T> struct C {13 T t;14 ~C(); // expected-note {{here}}15 };16 template<typename T> C<T>::~C() noexcept {} // expected-error {{does not match previous}}17}18