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 origin/main HEAD --extensions c,cpp --
clang/lib/AST/Decl.cpp clang/lib/Sema/SemaDecl.cpp
clang/test/Sema/tentative-decls.c --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</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 33839827a..4172bf74d 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4963,13 +4963,13 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult
&Previous) {
// [basic.def]p2 for details, but the basic idea is: if the old declaration
// contains the extern specifier and doesn't have an initializer, it's fine
// in C++.
- if (New->getTLSKind() != VarDecl::TLS_None &&
New->isThisDeclarationADefinition() == VarDecl::Definition) {
- VarDecl* Def = Old->getDefinition();
- if(Def && checkVarDeclRedefinition(Def, New)){
- return;
+ if (New->getTLSKind() != VarDecl::TLS_None &&
+ New->isThisDeclarationADefinition() == VarDecl::Definition) {
+ VarDecl *Def = Old->getDefinition();
+ if (Def && checkVarDeclRedefinition(Def, New)) {
+ return;
}
- }
- else if (Old->getStorageClass() != SC_Extern || Old->hasInit()) {
+ } else if (Old->getStorageClass() != SC_Extern || Old->hasInit()) {
Diag(New->getLocation(), diag::warn_cxx_compat_tentative_definition)
<< New;
Diag(Old->getLocation(), diag::note_previous_declaration);
``````````
</details>
https://github.com/llvm/llvm-project/pull/219780
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits