PR c++/85214 - ICE with alias, generic lambda, constexpr if.
commit50e68f9350a355b4a08ba82606789d3c3a163fc3
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Apr 2018 18:09:53 +0000 (6 18:09 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Apr 2018 18:09:53 +0000 (6 18:09 +0000)
tree09a519ef6a26c4fc39366f1fd44d9701a19e00ba
parent0e6feeb8a8241bd54ad7b0e08c08d4e5ae7ab203
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259185 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp1z/constexpr-if20.C [new file with mode: 0644]