[Bug c++/94523] [10 Regression] error: 'constexpr' evaluation depth exceeds maximum of 512 (use '-fconstexpr-depth=' to increase the maximum) since r10-7490-g76f09260b7eccd6c
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Apr 9 21:34:30 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94523
--- Comment #7 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:ef529765234bea7893bd56f3ab3a2da7695f6b21
commit r10-7669-gef529765234bea7893bd56f3ab3a2da7695f6b21
Author: Jason Merrill <jason@redhat.com>
Date: Wed Apr 8 23:59:30 2020 -0400
c++: constexpr static data member instantiation [PR94523]
Here due to my recent change to store_init_value we were expanding the
initializer of aw knowing that we were initializing aw. When
cxx_eval_call_expression finished the constructor, it wanted to look up the
value of aw to set TREE_READONLY on it, but we haven't set DECL_INITIAL
yet,
so decl_constant_value tried to instantiate the initializer again. And
infinite recursion. Stopped by optimizing the case of asking for the value
of ctx->object, which is ctx->value. It also would have worked to look in
the values hash table, so let's move that up before decl_constant_value as
well.
gcc/cp/ChangeLog
2020-04-09 Jason Merrill <jason@redhat.com>
PR c++/94523
* constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
ctx->object and ctx->global->values first.
More information about the Gcc-bugs
mailing list