PR c++/89422 - ICE with -g and lambda in default arg in template.
authorJason Merrill <jason@redhat.com>
Thu, 21 Feb 2019 23:07:47 +0000 (18:07 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 21 Feb 2019 23:07:47 +0000 (18:07 -0500)
commit4bcd47e2e1975635ea18d61accf7dcbf64306aa7
treed9de31bfc8c53aab2a8ee9e2a71c36c0d9799a23
parent5498361c0f4822b2c48f19835963afa5a630175b
PR c++/89422 - ICE with -g and lambda in default arg in template.

Here, we were trying to instantiate the default argument before setting
DECL_FRIEND_CONTEXT, so that the instantiated lambda ended up being treated
as part of the S template, which confused dwarf2out.

* pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.

From-SVN: r269081
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg9.C [new file with mode: 0644]