|
@@ -891,9 +891,9 @@ public:
|
|
|
/// DeclRefExprBits.HasTemplateKWAndArgsInfo:
|
|
|
/// Specifies when this declaration reference expression has an explicit
|
|
|
/// C++ template keyword and/or template argument list.
|
|
|
-/// DeclRefExprBits.RefersToCapturedVariable
|
|
|
+/// DeclRefExprBits.RefersToEnclosingVariableOrCapture
|
|
|
/// Specifies when this declaration reference expression (validly)
|
|
|
-/// refers to a captured variable.
|
|
|
+/// refers to an enclosed local or a captured variable.
|
|
|
class DeclRefExpr : public Expr {
|
|
|
/// \brief The declaration that we are referencing.
|
|
|
ValueDecl *D;
|
|
@@ -938,7 +938,7 @@ class DeclRefExpr : public Expr {
|
|
|
DeclRefExpr(const ASTContext &Ctx,
|
|
|
NestedNameSpecifierLoc QualifierLoc,
|
|
|
SourceLocation TemplateKWLoc,
|
|
|
- ValueDecl *D, bool RefersToCapturedVariable,
|
|
|
+ ValueDecl *D, bool RefersToEnlosingVariableOrCapture,
|
|
|
const DeclarationNameInfo &NameInfo,
|
|
|
NamedDecl *FoundD,
|
|
|
const TemplateArgumentListInfo *TemplateArgs,
|
|
@@ -953,7 +953,7 @@ class DeclRefExpr : public Expr {
|
|
|
void computeDependence(const ASTContext &C);
|
|
|
|
|
|
public:
|
|
|
- DeclRefExpr(ValueDecl *D, bool RefersToCapturedVariable, QualType T,
|
|
|
+ DeclRefExpr(ValueDecl *D, bool RefersToEnclosingVariableOrCapture, QualType T,
|
|
|
ExprValueKind VK, SourceLocation L,
|
|
|
const DeclarationNameLoc &LocInfo = DeclarationNameLoc())
|
|
|
: Expr(DeclRefExprClass, T, VK, OK_Ordinary, false, false, false, false),
|
|
@@ -962,22 +962,24 @@ public:
|
|
|
DeclRefExprBits.HasTemplateKWAndArgsInfo = 0;
|
|
|
DeclRefExprBits.HasFoundDecl = 0;
|
|
|
DeclRefExprBits.HadMultipleCandidates = 0;
|
|
|
- DeclRefExprBits.RefersToCapturedVariable = RefersToCapturedVariable;
|
|
|
+ DeclRefExprBits.RefersToEnclosingVariableOrCapture =
|
|
|
+ RefersToEnclosingVariableOrCapture;
|
|
|
computeDependence(D->getASTContext());
|
|
|
}
|
|
|
|
|
|
static DeclRefExpr *
|
|
|
Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc,
|
|
|
SourceLocation TemplateKWLoc, ValueDecl *D,
|
|
|
- bool RefersToCapturedVariable, SourceLocation NameLoc, QualType T,
|
|
|
- ExprValueKind VK, NamedDecl *FoundD = nullptr,
|
|
|
+ bool RefersToEnclosingVariableOrCapture, SourceLocation NameLoc,
|
|
|
+ QualType T, ExprValueKind VK, NamedDecl *FoundD = nullptr,
|
|
|
const TemplateArgumentListInfo *TemplateArgs = nullptr);
|
|
|
|
|
|
static DeclRefExpr *
|
|
|
Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc,
|
|
|
SourceLocation TemplateKWLoc, ValueDecl *D,
|
|
|
- bool RefersToCapturedVariable, const DeclarationNameInfo &NameInfo,
|
|
|
- QualType T, ExprValueKind VK, NamedDecl *FoundD = nullptr,
|
|
|
+ bool RefersToEnclosingVariableOrCapture,
|
|
|
+ const DeclarationNameInfo &NameInfo, QualType T, ExprValueKind VK,
|
|
|
+ NamedDecl *FoundD = nullptr,
|
|
|
const TemplateArgumentListInfo *TemplateArgs = nullptr);
|
|
|
|
|
|
/// \brief Construct an empty declaration reference expression.
|
|
@@ -1149,9 +1151,10 @@ public:
|
|
|
DeclRefExprBits.HadMultipleCandidates = V;
|
|
|
}
|
|
|
|
|
|
- /// \brief Does this DeclRefExpr refer to a captured variable?
|
|
|
- bool refersToCapturedVariable() const {
|
|
|
- return DeclRefExprBits.RefersToCapturedVariable;
|
|
|
+ /// \brief Does this DeclRefExpr refer to an enclosing local or a captured
|
|
|
+ /// variable?
|
|
|
+ bool refersToEnclosingVariableOrCapture() const {
|
|
|
+ return DeclRefExprBits.RefersToEnclosingVariableOrCapture;
|
|
|
}
|
|
|
|
|
|
static bool classof(const Stmt *T) {
|