[Bug c++/95486] ICE for alias CTAD with non-dependent argument and constrained constructor

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 30 02:15:23 GMT 2020


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

--- Comment #4 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:71141b1bd537cc516e485c834c2d36abba3f4544

commit r11-2419-g71141b1bd537cc516e485c834c2d36abba3f4544
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Jul 29 22:06:41 2020 -0400

    c++: alias_ctad_tweaks and constrained dguide [PR95486]

    In the below testcase, we're ICEing from alias_ctad_tweaks ultimately
    because the implied deduction guide for X's user-defined constructor
    already has constraints associated with it.  We then carry over these
    constraints to 'fprime', the overlying deduction guide for the alias
    template Y, via tsubst_decl from alias_ctad_tweaks.  Later in
    alias_ctad_tweaks we call get_constraints followed by set_constraints
    without doing remove_constraints in between, which triggers the !found
    assert in set_constraints.

    This patch fixes this issue by adding an intervening call to
    remove_constraints.

    gcc/cp/ChangeLog:

            PR c++/95486
            * pt.c (alias_ctad_tweaks): Call remove_constraints before
            calling set_constraints.

    gcc/testsuite/ChangeLog:

            PR c++/95486
            * g++.dg/cpp2a/class-deduction-alias3.C: New test.


More information about the Gcc-bugs mailing list