8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-89158.C
Marek Polacek 0d80643880 PR c++/89158 - by-value capture of constexpr variable broken.
* call.c (convert_like_real) <case ck_user>: Call mark_exp_read
	instead of mark_rvalue_use.

	* g++.dg/cpp0x/lambda/lambda-89158.C: New test.

From-SVN: r268561
2019-02-05 21:30:51 +00:00

12 lines
167 B
C

// PR c++/89158
// { dg-do compile { target c++11 } }
struct T { T(const int&); };
void Func(T);
void test()
{
constexpr int Val = 42;
[Val]() { Func(Val); };
}