Don't use the GNU extension form of line markers in MSVC mode.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Seems reasonable to me (but please update the comment before landing).
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
4218 ↗ | (On Diff #145446) | The comment needs an update I think. |
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
4218 ↗ | (On Diff #145446) | Thanks, will change into "-fno-use-line-directives is default, except for MSVC targets." before pushing. |
Please don't do this, this is actually really problematic, since #line directives lose information about what's a system header. That means the result of -E usually won't compile, since Windows headers are typically full of warnings and default-error warnings.
Oh, ok - I can revert it then; I didn't have any specific need for this, I just noticed that clang in msvc mode and cl.exe differed in this aspect.
Thanks! When one attempts to generate pre-processed source with clang and compile it with MSVC, you usually have to remove clang's internal intrinsic headers from the include search path, otherwise you'll end up with references to builtins that don't exist in MSVC. Adding an extra -fuse-line-directives flag is just one more thing that you have to remember for that corner-case usage.