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

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

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

commit r10-9169-gf5cea9c5c4f8cce36963973e432a8575ef9ffd63
Author: Jason Merrill <ja...@redhat.com>
Date:   Tue Dec 22 16:40:37 2020 -0500

    c++: Fix constexpr array ICE [PR98332]

    The element initializer was non-constant, so its CONSTRUCTOR element ended
    up NULL, so unshare_constructor crashed trying to look at it.  This patch
    fixes this in two places: First, by returning when we see a non-constant
    initializer; second, by not crashing on NULL.

    gcc/cp/ChangeLog:

            PR c++/98332
            * constexpr.c (unshare_constructor): Check for NULL.
            (cxx_eval_vec_init_1): Always exit early if non-constant.

    gcc/testsuite/ChangeLog:

            PR c++/98332
            * g++.dg/cpp0x/constexpr-overflow3.C: New test.

Reply via email to