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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to