[Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jun 12 16:40:53 GMT 2021


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

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

https://gcc.gnu.org/g:08e1ff9d6e5a419d5b4a60c077df549e81601d9b

commit r12-1404-g08e1ff9d6e5a419d5b4a60c077df549e81601d9b
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Jun 11 16:55:30 2021 -0400

    c++: constexpr and array[0] [PR101029]

    build_vec_init_elt exits early if we're initializing a zero-element array,
    so build_vec_init needs to do the same to avoid trying to instantiate
things
    after we've already started throwing important bits away.

            PR c++/101029

    gcc/cp/ChangeLog:

            * init.c (build_vec_init): Shortcut [0] case.

    gcc/testsuite/ChangeLog:

            * g++.dg/ext/array4.C: New test.


More information about the Gcc-bugs mailing list