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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Marek Polacek
<mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:0a9d8fd580d6afab669bae68e116e2135c2a8670

commit r11-8534-g0a9d8fd580d6afab669bae68e116e2135c2a8670
Author: Marek Polacek <pola...@redhat.com>
Date:   Mon Jun 7 16:06:00 2021 -0400

    c++: explicit() ignored on deduction guide [PR100065]

    When we have explicit() with a value-dependent argument, we can't
    evaluate it at parsing time, so cp_parser_function_specifier_opt stashes
    the argument into the decl-specifiers and grokdeclarator then stores it
    into explicit_specifier_map, which is then used when substituting the
    function decl.  grokdeclarator stores it for constructors and conversion
    functions, but we also need to do it for deduction guides, otherwise
    we'll forget that we've seen an explicit-specifier as in the attached
    test.

            PR c++/100065

    gcc/cp/ChangeLog:

            * decl.c (grokdeclarator): Store a value-dependent
            explicit-specifier even for deduction guides.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/explicit18.C: New test.

    (cherry picked from commit 1afa4facb9348cac0349ff9c30066aa25a3608f7)

Reply via email to