This is an updated patch from https://bugs.llvm.org/show_bug.cgi?id=15614. See there for testcase etc.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
A test case would be good (in the clang/test directory - probably near/in the other tests for -frewrite-includes)
And does the same bug occur for other preprocessor-related warnings? Maybe it's not practical to disable them all this way & there should be a different solution? (or maybe we shouldn't fix these and users can pass -w to disable warnings when using -frewrite-includes?)
Done.
And does the same bug occur for other preprocessor-related warnings? Maybe it's not practical to disable them all this way & there should be a different solution? (or maybe we shouldn't fix these and users can pass -w to disable warnings when using -frewrite-includes?)
I've never seen any other warning from -frewrite-includes besides -Wunused-macros. Given that I use and more or less maintain Icecream, which uses -frewrite-includes for distributed builds, I'd say any other warnings there either don't exist or are very rare (which rather makes sense, given that -frewrite-includes only does limited macro expansion when analysing the input and that's about it). Given that, I'd prefer not to disable warnings globally - they are unlikely to show up, if they do, they can hopefully be handled individually, but on the other hand maybe Clang one day gets warnings about #include or similar that would be a pity to miss when using -rewrite-includes.