Files
gcc-reflection/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg9.C
Jason Merrill 4bcd47e2e1 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
2019-02-21 18:07:47 -05:00

11 lines
182 B
C

// PR c++/89422
// { dg-do compile { target c++11 } }
// { dg-additional-options -g }
template <int> struct S
{
friend void foo (int a = []{ return 0; }()) {}
int b;
};
S<0> t;