llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) <details> <summary>Changes</summary> Pre C++11, we dont't need to get the value of IsImplicit. --- Full diff: https://github.com/llvm/llvm-project/pull/141951.diff 1 Files Affected: - (modified) clang/lib/AST/ByteCode/Interp.cpp (+9-10) ``````````diff diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp index e454d9e3bc218..136ab04558403 100644 --- a/clang/lib/AST/ByteCode/Interp.cpp +++ b/clang/lib/AST/ByteCode/Interp.cpp @@ -959,16 +959,15 @@ bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This) { if (!This.isZero()) return true; - const SourceInfo &Loc = S.Current->getSource(OpPC); - - bool IsImplicit = false; - if (const auto *E = dyn_cast_if_present<CXXThisExpr>(Loc.asExpr())) - IsImplicit = E->isImplicit(); - - if (S.getLangOpts().CPlusPlus11) - S.FFDiag(Loc, diag::note_constexpr_this) << IsImplicit; - else - S.FFDiag(Loc); + const Expr *E = S.Current->getExpr(OpPC); + if (S.getLangOpts().CPlusPlus11) { + bool IsImplicit = false; + if (const auto *TE = dyn_cast<CXXThisExpr>(E)) + IsImplicit = TE->isImplicit(); + S.FFDiag(E, diag::note_constexpr_this) << IsImplicit; + } else { + S.FFDiag(E); + } return false; } `````````` </details> https://github.com/llvm/llvm-project/pull/141951 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits