Defer building 'this' captures until we have left the capturing region
and returned to the context in which 'this' should be captured.
This means we now always mark 'this' referenced from the context in
which it's actually referenced, rather than potentially from some
context nested within that.
llvm-svn: 362182
diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp
index 90a3bb0..3a8e745 100644
--- a/clang/test/AST/ast-dump-expr-json.cpp
+++ b/clang/test/AST/ast-dump-expr-json.cpp
@@ -3941,8 +3941,7 @@
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "V *"
// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "implicit": true
+// CHECK-NEXT: "valueCategory": "rvalue"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@@ -4173,8 +4172,7 @@
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "V *"
// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "implicit": true
+// CHECK-NEXT: "valueCategory": "rvalue"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
diff --git a/clang/test/AST/ast-dump-expr.cpp b/clang/test/AST/ast-dump-expr.cpp
index 693dd57..47f69a8 100644
--- a/clang/test/AST/ast-dump-expr.cpp
+++ b/clang/test/AST/ast-dump-expr.cpp
@@ -255,7 +255,7 @@
// CHECK-NEXT: CXXMethodDecl
// CHECK-NEXT: CompoundStmt
// CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:8> col:8 implicit 'V *'
- // CHECK-NEXT: CXXThisExpr 0x{{[^ ]*}} <col:8> 'V *' implicit this
+ // CHECK-NEXT: CXXThisExpr 0x{{[^ ]*}} <col:8> 'V *' this
[*this]{};
// CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:7, col:15>
@@ -272,7 +272,7 @@
// CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:8> col:8 implicit 'V'
// CHECK-NEXT: ParenListExpr 0x{{[^ ]*}} <col:8> 'NULL TYPE'
// CHECK-NEXT: UnaryOperator 0x{{[^ ]*}} <col:8> '<dependent type>' prefix '*' cannot overflow
- // CHECK-NEXT: CXXThisExpr 0x{{[^ ]*}} <col:8> 'V *' implicit this
+ // CHECK-NEXT: CXXThisExpr 0x{{[^ ]*}} <col:8> 'V *' this
}
};
diff --git a/clang/test/SemaCXX/lambda-expressions.cpp b/clang/test/SemaCXX/lambda-expressions.cpp
index 8b0b830..311def9 100644
--- a/clang/test/SemaCXX/lambda-expressions.cpp
+++ b/clang/test/SemaCXX/lambda-expressions.cpp
@@ -105,7 +105,7 @@
a = static_cast<decltype(a)&&>(a); // expected-error {{copy assignment operator is implicitly deleted}}
}
struct P {
- P(const P&) = delete; // expected-note {{deleted here}}
+ P(const P&) = delete; // expected-note 2{{deleted here}}
};
struct Q {
~Q() = delete; // expected-note {{deleted here}}
@@ -117,7 +117,9 @@
R &operator=(R&&) = delete;
};
void g(P &p, Q &q, R &r) {
- auto pp = [p]{}; // expected-error {{deleted constructor}}
+ // FIXME: The note attached to the second error here is just amazingly bad.
+ auto pp = [p]{}; // expected-error {{deleted constructor}} expected-error {{deleted copy constructor of '(lambda}}
+ // expected-note@-1 {{copy constructor of '' is implicitly deleted because field '' has a deleted copy constructor}}
auto qq = [q]{}; // expected-error {{deleted function}} expected-note {{because}}
auto a = [r]{}; // expected-note 2{{here}}