[Bug c++/87709] c++17 class template argument deduction not working in a very specific case

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 24 04:14:57 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87709

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:5f1a2cb9c2dc09eed53da5d5787d14bec700b10b

commit r12-99-g5f1a2cb9c2dc09eed53da5d5787d14bec700b10b
Author: Patrick Palka <ppalka@redhat.com>
Date:   Sat Apr 24 00:01:42 2021 -0400

    c++: Hard error with tentative parse and CTAD [PR87709]

    When parsing e.g. the operand of sizeof, where both types and
    expressions are accepted, if during the tentative type parse we
    encounter an unexpected template placeholder, we must simulate
    an error rather than issue a real error because the expression
    parse can still succeed.

    gcc/cp/ChangeLog:

            PR c++/87709
            * parser.c (cp_parser_type_id_1): If we see a template
            placeholder, first try simulating an error before issuing
            a real error.

    gcc/testsuite/ChangeLog:

            PR c++/87709
            * g++.dg/cpp1z/class-deduction86.C: New test.


More information about the Gcc-bugs mailing list