This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 65579 ("gcc requires definition of a static constexpr member...")
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 6 Nov 2017 10:52:26 -0500
- Subject: Re: [C++ Patch] PR 65579 ("gcc requires definition of a static constexpr member...")
- Authentication-results: sourceware.org; auth=none
- References: <f763a8ed-ad24-8054-ddca-9380b30d4612@oracle.com> <CADzB+2mPpZczui=AgcipRSsyADy67YNH7Nn+Oxn2LP8YNQeWNA@mail.gmail.com> <e0c3b5ec-f3da-a9e3-875b-6948aea70ed5@oracle.com> <CADzB+2kUy_3v3R0R2n5FigoN3FZrJUQzvp1D0-yN1fXeay_Q5w@mail.gmail.com> <775e63e5-31fc-1e73-9cff-e92d511861b5@oracle.com>
OK, thanks.
On Fri, Nov 3, 2017 at 3:55 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Hi,
>
> On 03/11/2017 18:56, Jason Merrill wrote:
>>
>> Looking at the code again, it seems that the problem is the difference
>> between start_decl_1 and grokfield, in that the former has
>>
>> /* If an explicit initializer is present, or if this is a definition
>> of an aggregate, then we need a complete type at this point.
>> (Scalars are always complete types, so there is nothing to
>> check.) This code just sets COMPLETE_P; errors (if necessary)
>> are issued below. */
>> if ((initialized || aggregate_definition_p)
>> && !complete_p
>> && COMPLETE_TYPE_P (complete_type (type)))
>> {
>> complete_p = true;
>> /* We will not yet have set TREE_READONLY on DECL if the type
>> was "const", but incomplete, before this point. But, now, we
>> have a complete type, so we can try again. */
>> cp_apply_type_quals_to_decl (cp_type_quals (type), decl);
>> }
>>
>> and grokfield/finish_static_data_member_decl don't. How about
>> completing the type and re-applying the quals in
>> finish_static_data_member_decl if there's an initializer? Your most
>> recent patch ought to work, but is less parallel. Sorry for the
>> churn.
>
> No problem, I learned something! Anyway, yes, the below is passing testing,
> shall we go ahead with it?
>
> Thanks,
> Paolo.
>
> ///////////////////////