diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 98061e6c494..3e8a0d0dc14 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -4666,8 +4666,13 @@ public: // Can't look at 'this' when checking a potential constant expression. if (Info.checkingPotentialConstantExpression()) return false; - if (!Info.CurrentCall->This) - return Error(E); + if (!Info.CurrentCall->This) { + if (Info.getLangOpts().CPlusPlus11) + Info.Diag(E, diag::note_constexpr_this) << E->isImplicit(); + else + Info.Diag(E); + return false; + } Result = *Info.CurrentCall->This; return true; } |