This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 03/29/2012 09:27 PM, Jason Merrill wrote:Sorry for essentially self-replying, but today, while I was traveling, I reviewed in my mind your comments over the last days, and I think I had a buglet in the patch which I sent in the last message: it doesn't make sure, in grokfndecl, to *not* call deduce_noexcept_on_destructor on a destructor of a class still being defined. Thus I'm adding a !TYPE_BEING_DEFINED (DECL_CONTEXT (decl)) check and the complete patch (which I'm attaching below) still passes testing. I also double checked that, for a simple case like:On 03/29/2012 03:06 PM, Paolo Carlini wrote:Oh my, as simple as the below appears to work!I seem to remember something going wrong with templates otherwise,The exception specification on old_decl doesn't matter; we can drop that test.
because implicitly_declare_fn has gcc_assert (!dependent_type_p (type));
We shouldn't be doing this for templates anyway, as in general we can't know what the implicitly declared function will look like.
I simply added a !processing_template_decl check. Then I removed the deduce_noexcept_on_destructor calls in register_specialization and when I found a proper place in grokfndecl (must be before check_explicit_specialization) I noticed that apparently I can remove the other deduce_noexcept_on_destructor call which I had later on in grokfndecl. Thus the below passes the (updated) testsuite on x86_64-linux.
struct A { ~A(); };
Thanks, Paolo.
Attachment:
patch_50043_draft_3
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |