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

Nishith Kumar M Shah via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 9 22:26:11 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)) {
----------------
nishithshah2211 wrote:

@AaronBallman @jansvoboda11 @cor3ntin wanted to continue more on this after a long gap I took. How can we reach a consensus? Unfortunately, I am pretty new to Clang and do not understand the implications of making a choice one way or another (which is what this thread is about, so thank you all for nice discussion!).

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


More information about the cfe-commits mailing list