From 70ba243c6a6ed645efa20443026c520c2d62ff72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Wed, 19 Apr 2023 08:10:13 +0200 Subject: [PATCH] [clang][Interp][NFC] Small State.cpp refactoring --- clang/lib/AST/Interp/State.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/lib/AST/Interp/State.cpp b/clang/lib/AST/Interp/State.cpp index f0eed85..2512979 100644 --- a/clang/lib/AST/Interp/State.cpp +++ b/clang/lib/AST/Interp/State.cpp @@ -142,12 +142,12 @@ void State::addCallStack(unsigned Limit) { // Use a different note for an inheriting constructor, because from the // user's perspective it's not really a function at all. - if (auto *CD = dyn_cast_if_present(F->getCallee())) { - if (CD->isInheritingConstructor()) { - addDiag(CallLocation, diag::note_constexpr_inherited_ctor_call_here) - << CD->getParent(); - continue; - } + if (const auto *CD = + dyn_cast_if_present(F->getCallee()); + CD && CD->isInheritingConstructor()) { + addDiag(CallLocation, diag::note_constexpr_inherited_ctor_call_here) + << CD->getParent(); + continue; } SmallString<128> Buffer; -- 2.7.4