OK, thanks.
On Fri, Nov 3, 2017 at 3:55 PM, Paolo Carlini <paolo.carl...@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. > > ///////////////////////