[Bug c++/85214] [7/8 Regression] ICE on valid C++17 code on x86_64-linux-gnu: in tsubst_copy, at cp/pt.c:14562
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 6 18:10:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85214
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Apr 6 18:09:53 2018
New Revision: 259185
URL: https://gcc.gnu.org/viewcvs?rev=259185&root=gcc&view=rev
Log:
PR c++/85214 - ICE with alias, generic lambda, constexpr if.
Here, since the condition for the constexpr if depends on the type of 'j',
it's still dependent when we are partially instantiating the inner lambda,
so we need to defer instantiating the constexpr if. When we instantiated
the inner lambda, we tried to substitute into the typename, which failed
because we didn't have a declaration of 'i' available.
Fixed by teaching extract_locals_r to capture local typedefs such as 'ar';
if we have the typedef handy, we don't need to substitute into its
definition.
* pt.c (extract_locals_r): Remember local typedefs.
Added:
trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if20.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
More information about the Gcc-bugs
mailing list