[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 00:17:08 PDT 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 9617da88ab961145047076c45bb2bb1ac4513634 07424d8ee99fc418d071960bbdd4185564025139 -- clang/lib/Sema/JumpDiagnostics.cpp clang/lib/Sema/SemaDecl.cpp clang/test/AST/ast-dump-recovery.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6075624722..e802d41ddc 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -13444,7 +13444,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) {
     if (!Method->isInvalidDecl()) {
       // Pure-specifiers are handled in ActOnPureSpecifier.
       Diag(Method->getLocation(), diag::err_member_function_initialization)
-        << Method->getDeclName() << Init->getSourceRange();
+          << Method->getDeclName() << Init->getSourceRange();
       Method->setInvalidDecl();
     }
     return;

``````````

</details>


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


More information about the cfe-commits mailing list