From: Timm Bäder Date: Wed, 19 Apr 2023 06:10:13 +0000 (+0200) Subject: [clang][Interp][NFC] Small State.cpp refactoring X-Git-Tag: upstream/17.0.6~11123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70ba243c6a6ed645efa20443026c520c2d62ff72;p=platform%2Fupstream%2Fllvm.git [clang][Interp][NFC] Small State.cpp refactoring --- 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;