[clang] 70ba243 - [clang][Interp][NFC] Small State.cpp refactoring

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 18 23:13:38 PDT 2023


Author: Timm Bäder
Date: 2023-04-19T08:13:16+02:00
New Revision: 70ba243c6a6ed645efa20443026c520c2d62ff72

URL: https://github.com/llvm/llvm-project/commit/70ba243c6a6ed645efa20443026c520c2d62ff72
DIFF: https://github.com/llvm/llvm-project/commit/70ba243c6a6ed645efa20443026c520c2d62ff72.diff

LOG: [clang][Interp][NFC] Small State.cpp refactoring

Added: 
    

Modified: 
    clang/lib/AST/Interp/State.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/State.cpp b/clang/lib/AST/Interp/State.cpp
index f0eed85054ce9..2512979257605 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 
diff erent 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<CXXConstructorDecl>(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<CXXConstructorDecl>(F->getCallee());
+        CD && CD->isInheritingConstructor()) {
+      addDiag(CallLocation, diag::note_constexpr_inherited_ctor_call_here)
+          << CD->getParent();
+      continue;
     }
 
     SmallString<128> Buffer;


        


More information about the cfe-commits mailing list