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]

Re: [C++ PATCH] For -std=c++1z treat class types with inherited ctors as non-aggregate (PR c++/79143)


On Wed, Feb 8, 2017 at 5:24 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Feb 08, 2017 at 04:51:54PM -0500, Jason Merrill wrote:
>> On Tue, Feb 7, 2017 at 4:30 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>> > P0017R1 added in [dcl.init.aggr]/1 that classes with inherited constructors
>> > are not aggregate.  CLASSTYPE_NON_AGGREGATE is set slightly before
>> > add_implicitly_declared_members is called and so we don't know about the
>> > inherited ctors yet.
>>
>> Hmm, why doesn't my patch for 78124 to set CLASSTYPE_NON_AGGREGATE in
>> do_class_using_decl cover this testcase?
>
> It does set CLASSTYPE_NON_AGGREGATE on a different RECORD_TYPE,
> do_class_using_decl sees the template, while what is tested and what
> check_bases_and_members is called on is the implicit instantiation thereof.
>
> The following completely untested patch also fixes it.  Or is there some
> even better place where to copy over that bit from the template to the
> instantiation?

Better I think in instantiate_class_template_1, about where we copy TYPE_PACKED.

Jason


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