[PATCH] D124534: [clang] Add a diagnostic for line directive of a gnu extension

Ken Matsui via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 19:02:04 PDT 2022


ken-matsui added a comment.

In D124534#3490732 <https://reviews.llvm.org/D124534#3490732>, @aaron.ballman wrote:

> The tests run in -cc1 mode and don't #include anything, so I don't think the issue is an internally included SDK. I think the issue could be from this: https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/InitPreprocessor.cpp#L1355 and https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/InitPreprocessor.cpp#L1368. You may have to hook up to a debugger to see why we're issuing those surprising warnings. If it turns out that it's these inserted directives, you may have to look at the source location of the digit token to see if `isWrittenInBuiltinFile()` is true or not (and we may need to also check `isWrittenInScratchSpace()` as well, perhaps).

Thank you for the information! I'm going to look into the source code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124534/new/

https://reviews.llvm.org/D124534



More information about the cfe-commits mailing list