This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Fix PR c++/88095, class template argument deduction for literal operator templates per P0732 for C++2a
- From: Jason Merrill <jason at redhat dot com>
- To: Tom Honermann <tom at honermann dot net>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jeff Snyder <jeff-isocpp at caffeinated dot me dot uk>, Hana Dusíková <hana dot dusikova at avast dot com>
- Date: Mon, 5 Aug 2019 15:05:13 -0400
- Subject: Re: [PATCH]: Fix PR c++/88095, class template argument deduction for literal operator templates per P0732 for C++2a
- References: <58ee7adc-9dd6-f1df-5934-87e6185d24dd@honermann.net>
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.
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.
Jason