8sa1-gcc/gcc/testsuite/g++.dg/cpp1z/lambda-this7.C
Jason Merrill 4b68cb38dd c++: *this capture in const member fn [PR95193].
Here, the capture proxy for *this is const, but its DECL_VALUE_EXPR is not.
Don't ICE on this; it's a reasonable difference, since in C++ an rvalue of
scalar type does not have cv-qualifiers.

gcc/cp/ChangeLog:

	PR c++/95193
	* pt.c (tsubst_decl): Relax assert.

gcc/testsuite/ChangeLog:

	PR c++/95193
	* g++.dg/cpp1z/lambda-this7.C: New test.
2020-06-02 15:00:00 -04:00

12 lines
151 B
C

// PR c++/95193
// { dg-do compile { target c++17 } }
struct X {
void foo() const {
auto GL1 = [*this](auto a) {
};
GL1("abc");
}
};