================
@@ -264,3 +264,28 @@ void test() {
// CHECK: call void @_ZNH5P27971C1cERKS0_
// CHECK: call void @_ZN5P27971C1cEi
}
+
+// This used to crash because we weren’t instantiating a dependent 'this'.
+namespace GH154054 {
+struct S {
+ int x;
+ auto byval() {
+ return [*this](this auto) { return this->x; };
+ }
+};
+
+void main() {
+ S s{ 42 };
+
+ if ( s.byval()() != 42)
+ __builtin_abort();
----------------
cor3ntin wrote:
This doesn't do much, maybe we want check lines to verify we refer to the
correct object?
https://github.com/llvm/llvm-project/pull/154276
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits