diff options
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 8897667592..0f8de63bba 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -127,7 +127,8 @@ namespace { // The order of this enum is important for diagnostics. enum CheckSubobjectKind { - CSK_Base, CSK_Derived, CSK_Field, CSK_ArrayToPointer, CSK_ArrayIndex + CSK_Base, CSK_Derived, CSK_Field, CSK_ArrayToPointer, CSK_ArrayIndex, + CSK_This }; /// A path from a glvalue to a subobject of that glvalue. @@ -2362,6 +2363,9 @@ public: } else return Error(E); + if (This && !This->checkSubobject(Info, E, CSK_This)) + return false; + const FunctionDecl *Definition = 0; Stmt *Body = FD->getBody(Definition); APValue Result; |