[llvm-bugs] [Bug 37990] New: -frewrite-includes doesn't handle __has_include in macro expansion

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 29 09:37:09 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37990

            Bug ID: 37990
           Summary: -frewrite-includes doesn't handle __has_include in
                    macro expansion
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arichardson.kde at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

I was trying to get a reduced test case for a crash in libc++ and QtBase but I
couldn't use clang -cc1 on the preprocessed source. It would fail with
compilation errors instead of the assertion I was trying to track down.
It turns out that both of these projects have a custom macro wrapping
__has_include()
and -frewrite-includes does not rewrite that to 0 or 1 so the invocation fails
on the rewritten source.

I have added a local hack to handle the Qt and libc++ macro names in
https://github.com/CTSRD-CHERI/clang/commit/05aafbf0c6cd7099b7d53466b58a8b8214d29f33
but I guess a real fix is needed instead. If people are interested I'm happy to
put it up for review. Especially the libc++ macro is probably used in lots of
crash reproducers so it might help with getting a reduced test case from
C++-specific crashes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180629/6b76606f/attachment.html>


More information about the llvm-bugs mailing list