[PATCH]: Fix PR c++/88095, class template argument deduction for literal operator templates per P0732 for C++2a

Tom Honermann tom@honermann.net
Tue Aug 6 15:30:00 GMT 2019


On 8/5/19 3:05 PM, Jason Merrill wrote:
> On 8/2/19 9:59 AM, Tom Honermann wrote:
>> This patch fixes PR c++/88095:
>> - Bug 88095 - class nontype template parameter UDL string literals 
>> doesn't accepts deduction placeholder
>> - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88095.
>>
>> It also addresses a latent issue; literal operator templates with 
>> template parameter packs of literal class type were previously 
>> accepted.   The patch corrects this and adds a test 
>> (udlit-class-nttp-neg.C).
>>
>> In the change to gcc/cp/parser.c, it is not clear to me whether the 
>> 'TREE_CODE (TREE_TYPE (parm)) == TEMPLATE_TYPE_PARM' comparison is 
>> necessary; it might be that 'CLASS_PLACEHOLDER_TEMPLATE' suffices on 
>> its own.
>
> template_placeholder_p would be a shorter way to write these, but I 
> think even better would be to just change CLASS_TYPE_P to 
> MAYBE_CLASS_TYPE_P.  I'll make that change and commit the patch, since 
> it looks like you don't have commit access yet.
Thanks, and correct, I don't have commit access yet (and I'm not sure 
that I should! :) )
>
>> If accepted, I'd like to request this change be applied to gcc 9 as 
>> it is needed for one of the char8_t remediation approaches documented 
>> in P1423, and may be helpful for existing code bases impacted by the 
>> char8_t changes adopted via P0482 for C++20.
>> - https://wg21.link/p1423#emulate
>
> Seems reasonable.  It may be too late to make 9.2 at this point, though.

Is there anything I can/should do to request inclusion?

Tom.

>
> Jason




More information about the Gcc-patches mailing list