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

--- Comment #2 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:66de517b1c1dd22df7914f8e9a083cd5a73adbe2

commit r11-7997-g66de517b1c1dd22df7914f8e9a083cd5a73adbe2
Author: Patrick Palka <ppa...@redhat.com>
Date:   Mon Apr 5 23:35:56 2021 -0400

    c++: placeholder type constraint in structured binding [PR99899]

    In this PR, we're crashing because the constraint handling inside
    do_auto_deduction doesn't expect to see an adc_decomp_type context.
    This patch fixes this by treating adc_decomp_type like adc_variable_type
    or adc_return_type during placeholder type constraint checking.

    Meanwhile, I noticed we weren't checking constraints at all when binding
    an array via a structured binding, since do_auto_deduction would exit
    early and bypass the constraint check.  This patch fixes this by
    replacing the early exit with an appropriate setup of the 'targs'
    vector.

    gcc/cp/ChangeLog:

            PR c++/99899
            * pt.c (do_auto_deduction): Don't exit early when deducing the
            array type of a structured binding.  Also handle adc_decomp_type
            during constraint checking.

    gcc/testsuite/ChangeLog:

            PR c++/99899
            * g++.dg/cpp2a/concepts-placeholder7.C: New test.
            * g++.dg/cpp2a/concepts-placeholder8.C: New test.

Reply via email to