[clang] clang: Relax LangOpts checks when lexing quoted numbers during preprocessing (PR #95798)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 00:27:54 PST 2024


================
@@ -2068,7 +2068,8 @@ bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
   }
 
   // If we have a digit separator, continue.
-  if (C == '\'' && (LangOpts.CPlusPlus14 || LangOpts.C23)) {
+  if (C == '\'' &&
+      (LangOpts.CPlusPlus14 || LangOpts.C23 || ParsingPreprocessorDirective)) {
----------------
cor3ntin wrote:

Yeah, I still favor a "DependencyScanning" option over feature specific flags, it seems much simpler to maintain and document in the long run, for exactly the same reason as @AaronBallman 

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


More information about the cfe-commits mailing list