c++: dependent local extern decl ICE [PR97171]
authorNathan Sidwell <nathan@acm.org>
Wed, 23 Sep 2020 14:01:10 +0000 (07:01 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 23 Sep 2020 14:18:54 +0000 (07:18 -0700)
commit13f7c5d504b5fe6c233f2e68acd10bd4fc9007ac
tree66e0e66297f31fe72e8ecf90fb8a81ae5c6c85d2
parentc48ffe21f8f3478cf08f9442e3f973df358caf2a
c++: dependent local extern decl ICE [PR97171]

I'd missed the piece of substutution for the uses of a local extern
decl.  Just grab the local specialization.  We need to do this
regardless of dependentness because we always cloned the local extern.

PR c++/97171
gcc/cp/
* pt.c (tsubst_copy) [FUNCTION_DECL,VAR_DECL]: Retrieve local
specialization for DECL_LOCAL_P decls.
gcc/testsuite/
* g++.dg/template/local10.C: New.
gcc/cp/pt.c
gcc/testsuite/g++.dg/template/local10.C [new file with mode: 0644]