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

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

https://gcc.gnu.org/g:c616e86e8bc76f867242b4aba372736d1c8cbf80

commit r10-9332-gc616e86e8bc76f867242b4aba372736d1c8cbf80
Author: Marek Polacek <pola...@redhat.com>
Date:   Fri Jan 29 11:29:25 2021 -0500

    c++: Improve sorry for __builtin_has_attribute [PR98355]

    __builtin_has_attribute doesn't work in templates yet (bug 92104), so
    in r11-471 I added a sorry.  But that only caught type-dependent
    expressions and we also want to sorry on value-dependent expressions.
    This patch uses uses_template_parms, but guarded with p_t_d, because
    u_t_p sets p_t_d and then v_d_e_p considers variables with reference
    types value-dependent, which breaks builtin-has-attribute-6.c.

    This is a regression and I also plan to apply this to gcc-10.

    gcc/cp/ChangeLog:

            PR c++/98355
            * parser.c (cp_parser_has_attribute_expression): Use
            uses_template_parms instead of type_dependent_expression_p.

    gcc/testsuite/ChangeLog:

            PR c++/98355
            * g++.dg/ext/builtin-has-attribute2.C: New test.

    (cherry picked from commit bab669f2fc643cb1673aecd177eec1c773e9e48e)

Reply via email to