On 03/30/2012 09:34 PM, Paolo Carlini wrote:
Thus I'm adding a
!TYPE_BEING_DEFINED (DECL_CONTEXT (decl)) check

Sounds good.

we reject, with a "different exception specifier" error, both:

template<typename T>
struct A
{
  ~A() noexcept;
};

template<typename T>
A<T>::~A() { }

and:

template<typename T>
struct A
{
  ~A();
};

template<typename T>
A<T>::~A() noexcept { }

Over the last days I wasted a lot of time trying painfully to not reject 
either, but actually now I'm pretty sure that we are right to reject the former 
(there are exception specifiers on the declaration thus automatic deduction 
should not trigger at all) and probably also the latter.

I'm OK with that, as long as we correctly allow

struct B
{
  ~B() noexcept;
};

B::~B() { }

and

struct B
{
  ~B();
};
B::~B() noexcept { }

The patch is OK.

Jason

Reply via email to