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.
12 lines
151 B
C
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");
|
|
}
|
|
};
|