[clang] [clang] emit an error when the same identifier appears with both internal and external linkage in a translation unit (PR #78064)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 13 12:27:10 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 66786a79d6f622012879e94a92838449bf175a71 da9e05f5574bae712a14a3b467d5b3944418b421 -- clang/lib/Sema/SemaDecl.cpp clang/test/Sema/private-extern.c
``````````
</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 9990bb72a8..6598a72b44 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4754,7 +4754,7 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
return New->setInvalidDecl();
}
- if (Old->getFormalLinkage() != New->getFormalLinkage() ) {
+ if (Old->getFormalLinkage() != New->getFormalLinkage()) {
Diag(New->getLocation(), diag::err_multiple_linkage) << New->getDeclName();
return New->setInvalidDecl();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/78064
More information about the cfe-commits
mailing list