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

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

https://gcc.gnu.org/g:72d0ef73d2cd46bda2f28e1866d637cfe8edb208

commit r10-7895-g72d0ef73d2cd46bda2f28e1866d637cfe8edb208
Author: Patrick Palka <ppa...@redhat.com>
Date:   Wed Apr 22 15:57:39 2020 -0400

    c++: Inherited constructor template arguments [PR94719]

    My fix for PR94549 broke constraints_satisfied_p in the case where the
inherited
    constructor decl points to an instantiation of a constructor template
coming
    from an instantiation of a class template.

    This is because the DECL_TI_ARGS of the inherited constructor decl in this
case
    contains only the innermost level of template arguments (those for the
    constructor template), but constraint satisfaction expects to have the full
set
    of template arguments.  This causes template argument substitution during
    constraint satisfaction to fail in various ways.

    On the other hand, the DECL_TI_ARGS of the DECL_INHERITED_CTOR is a full
set of
    template arguments but with the innermost level still in its dependent
form,
    which is the source of PR94549.  So if we could combine these two sets of
    template arguments then we'd be golden.

    This patch does just that, by effectively reverting the fix for PR94549 and
    instead using add_outermost_template_args to combine the template arguments
of
    the inherited constructor decl with those of its DECL_INHERITED_CTOR.

    gcc/cp/ChangeLog:

            PR c++/94719
            PR c++/94549
            * constraint.cc (satisfy_declaration_constraints): If the inherited
            constructor points to an instantiation of a constructor template,
            remember and use its attached template arguments.

    gcc/testsuite/ChangeLog:

            PR c++/94719
            PR c++/94549
            * g++.dg/cpp2a/concepts-inherit-ctor9.C: New test.

Reply via email to