[clang] [Clang] Fix handling of immediate escalation for inherited constructors (PR #112860)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 05:51:33 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 54c6a592a078d0a2d484f8a64ac0f1ed47f79e35 ca10f9df93b987c6684cd2d211e6262258f3b2ae --extensions cpp,h -- clang/include/clang/Sema/Sema.h clang/lib/AST/Decl.cpp clang/lib/AST/TextNodeDumper.cpp clang/test/SemaCXX/cxx2b-consteval-propagate.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 11a8ec5b56..9e153c8bca 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -3285,10 +3285,9 @@ bool FunctionDecl::isImmediateEscalating() const {
     return true;
 
   if (auto *CD = dyn_cast<CXXConstructorDecl>(this);
-      CD && CD->isInheritingConstructor() && CD->getInheritedConstructor()
-        .getConstructor()
-        ->isImmediateEscalating())
-      return true;
+      CD && CD->isInheritingConstructor() &&
+      CD->getInheritedConstructor().getConstructor()->isImmediateEscalating())
+    return true;
 
   // - a function that results from the instantiation of a templated entity
   // defined with the constexpr specifier.
diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp
index 9055a103bb..34c2de2d71 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -306,8 +306,8 @@ void TextNodeDumper::Visit(const Decl *D) {
       OS << " constexpr";
     if (FD->isConsteval())
       OS << " consteval";
-    //else if (FD->isImmediateFunction())
-    //  OS << " immediate";
+    // else if (FD->isImmediateFunction())
+    //   OS << " immediate";
     if (FD->isMultiVersion())
       OS << " multiversion";
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/112860


More information about the cfe-commits mailing list