================
@@ -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)) {
----------------
jansvoboda11 wrote:

We've been trying to avoid specializing Clang itself for dependency scanning. 
Instead, we have introduced generic feature flags that the scanner uses to 
tweak the compiler behavior. I think this is better for layering and also 
forces us to name those features, making the code self-documenting. People 
working on Clang don't have to wonder what's dependency scanning and why it 
needs to lex numeric literals differently; they just see there's a feature flag 
named `AllowLiteralDigitSeparator` that just makes sense in that context. You 
can still dive deeper and find that it's the scanner that enables that feature 
of course.

So I'm not a fan of introducing `LanguageOpts::ScanningDependencies`.

https://github.com/llvm/llvm-project/pull/95798
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to