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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 10:55:05 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)) {
----------------
AaronBallman wrote:

@jansvoboda11, @cor3ntin -- has your opinion changed at all? I'm still pretty strongly opposed to adding feature-specific flags to `LangOptions` for supporting this in dependency scanning. CC @erichkeane @Sirraide @Fznamznon for more opinions as well.

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


More information about the cfe-commits mailing list