[Bug c++/104470] [10/11/12 Regression] internal compiler error: Segmentation fault compiling std::variant with -std=c++20

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun May 15 16:29:34 GMT 2022


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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:73b47159d7811cf1d7aaaf78dbdd141161b93ca3

commit r12-8379-g73b47159d7811cf1d7aaaf78dbdd141161b93ca3
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Apr 27 11:13:24 2022 -0400

    c++: alias CTAD and member alias templates [PR104470]

    In this testcase, we were trying to substitute into
    variant<Foo<T>>::__accepted_type, but failed to look it up because
    variant<Foo<T>> doesn't exist.  In other cases we already rewrite such
    things into a dependent reference; we need to do that for alias templates
as
    well.

    This caused some testsuite regressions on alias uses outside of deduction
    guides, so I've made all of this rewriting conditional on a new tf_dguide
    tsubst flag.

            PR c++/104470

    gcc/cp/ChangeLog:

            * cp-tree.h (enum tsubst_flags): Add tf_dguide.
            * pt.cc (tsubst_aggr_type): Check it.
            (tsubst_baselink, tsubst_copy): Check it.
            (maybe_dependent_member_ref): Check it.
            (instantiate_alias_template): Handle it.
            (build_deduction_guide): Set it.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/explicit11.C: Second example also ill-formed.
            * g++.dg/cpp2a/class-deduction-alias12.C: New test.


More information about the Gcc-bugs mailing list