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]

C++ PATCH to lambda in default argument of inherited constructor


When inheriting a template constructor, we've been leaving the
template in DECL_INHERITED_CTOR rather than the appropriate
specialization; this leads to a crash when we try to mangle the
context for a lambda in a default argument for such a function.

This patch fixes this by remembering which specialization we found in
synthesized_method_walk and setting DECL_INHERITED_CTOR to that.

While I was looking at this, I noticed that the class template
argument deduction code's use of DECL_ABSTRACT_ORIGIN was misleading;
it refers to the constructor from which a deduction guide was
generated, not an abstract version of the same function.  I've moved
that information to DECL_ABSTRACT_ORIGIN on the template instead,
which shouldn't confuse anything because we never look at the
DECL_ABSTRACT_ORIGIN of other templates.

Tested x86_64-pc-linux-gnu, applying to trunk.

Attachment: lambda-inhctor.diff
Description: Text document

Attachment: cd-abstract.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]