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] |
Hi,it seems to me that in order to fix this accepts-invalid (for the testcase we don't reject the declaration 'B b;') we have simply to propagate from bases to derived the CLASSTYPE_READONLY_FIELDS_NEED_INIT and CLASSTYPE_REF_FIELDS_NEED_INIT flags. Thus, the few class.c lines in the patch below. Then I think we can also make the error messages in diagnose_uninitialized_cst_or_ref_member_1 more clear and explicitly mention the base to which the problematic member belongs.
Tested x86_64-linux. Thanks, Paolo.PS: I struggled a bit with "%qT" vs "%q#T": I would slightly prefer simply talking about, eg, "base class 'A'", we do that in other cases, but here we are already using # which automatically picks class vs struct. Thus I think we should use # for the base too... or remove all the #s and just talk about, eg, "class 'B'" and "base class 'A'" for these structs too?
//////////////
Attachment:
CL_58126
Description: Text document
Attachment:
patch_58126
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |