]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/88095, CTAD for literal operator templates per P0732
authorTom Honermann <tom@honermann.net>
Mon, 12 Aug 2019 17:46:37 +0000 (17:46 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 12 Aug 2019 17:46:37 +0000 (13:46 -0400)
commit6e21f7d2cc16e7189e78fbe85c1617d1240268e1
tree7dd6f3bb100a418b21e5e035b3740a1fb25102bd
parent0b8c26032610d97d92a4d14a9ebb693fec0f75b8
PR c++/88095, CTAD for literal operator templates per P0732

This patch fixes PR c++/88095: class nontype template parameter UDL string
literals doesn't accepts deduction placeholder

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).

This fix 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.

gcc/cp/ChangeLog:

2019-08-02  Tom Honermann  <tom@honermann.net>

        * parser.c (cp_parser_template_declaration_after_parameters): Enable
        class template argument deduction for non-type template parameters
        in literal operator templates.

gcc/testsuite/ChangeLog:

2019-08-02  Tom Honermann  <tom@honermann.net>

        PR c++/88095
        * g++.dg/cpp2a/udlit-class-nttp-ctad.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-neg.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-neg2.C: New test.

From-SVN: r274317
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp.C [new file with mode: 0644]