[clang] [clang] Add an ABI_EXTENSION concept that is testable under -pedantic… (PR #153506)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 13 16:20:08 PDT 2025
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 HEAD~1 HEAD --extensions c,cpp -- clang/lib/Frontend/FrontendActions.cpp clang/lib/Lex/PPMacroExpansion.cpp clang/test/Sema/ptrauth-qualifier.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index c925e1f8a..cf988760b 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -1183,7 +1183,7 @@ void DumpCompilerOptionsAction::ExecuteAction() {
OS << "\n\"extensions\" : [\n";
{
llvm::SmallString<128> Str;
-#define EXTENSION_OPTION(Name, Predicate) \
+#define EXTENSION_OPTION(Name, Predicate) \
("\t{\"" #Name "\" : " + llvm::Twine(Predicate ? "true" : "false") + "},\n") \
.toVector(Str);
#define EXTENSION(Name, Predicate) EXTENSION_OPTION(Name, Predicate)
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 7cae6acc0..11814fd74 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -1118,7 +1118,7 @@ static bool HasExtension(const Preprocessor &PP, StringRef Extension) {
#define ABI_EXTENSION(Name, Predicate) .Case(#Name, Predicate)
bool IsABIExtension = llvm::StringSwitch<bool>(Extension)
#include "clang/Basic/Features.def"
- .Default(false);
+ .Default(false);
#undef ABI_EXTENSION
if (IsABIExtension)
return true;
``````````
</details>
https://github.com/llvm/llvm-project/pull/153506
More information about the cfe-commits
mailing list