[clang] [Clang] Move the builtin workaround logic to the lexer (PR #96097)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 29 05:49:39 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 f80bd9b8a8103f39f5fece019abf86d41098cec1 f860bb65f8fe82aa1d5b727abb20de1cb8164b7e -- clang/include/clang/Basic/IdentifierTable.h clang/include/clang/Lex/Preprocessor.h clang/include/clang/Parse/Parser.h clang/lib/Basic/IdentifierTable.cpp clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Lex/Preprocessor.cpp clang/lib/Parse/ParseDecl.cpp clang/lib/Parse/ParseDeclCXX.cpp clang/lib/Parse/ParseExpr.cpp clang/test/PCH/cxx-traits.cpp clang/test/PCH/cxx-traits.h clang/test/SemaCXX/libcxx_is_trivially_equality_comparable_hack.cpp clang/test/SemaCXX/libstdcxx_is_nothrow_convertible_hack.cpp clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index e734183fbd..c9e46966dd 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -837,7 +837,8 @@ bool Preprocessor::HandleIdentifier(Token &Identifier) {
     II.setIsFutureCompatKeyword(false);
   }
 
-  if (II.isReusableBuiltinName() && !isNextPPTokenLParen() && !EvaluatingHasBuiltinMacro) {
+  if (II.isReusableBuiltinName() && !isNextPPTokenLParen() &&
+      !EvaluatingHasBuiltinMacro) {
     Identifier.setKind(tok::identifier);
     Diag(Identifier, diag::warn_deprecated_builtin_replacement) << II.getName();
   }

``````````

</details>


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


More information about the cfe-commits mailing list