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

            Bug ID: 26771
           Summary: -frewrite-includes: Lack of an exit line directive in
                    case of an empty header
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Consider simple case:

empty.cpp:
    #include "empty.h"

empty.h has 0-size.

"clang -E -frewrite-includes empty.cpp" produces:

    # 1 "<built-in>"
    # 1 "empty.cpp"
    #if 0 /* expanded by -frewrite-includes */
    #include "empty.h"
    #endif /* expanded by -frewrite-includes */
    # 1 "empty.cpp"
    # 1 "./empty.h" 1
    # 2 "empty.cpp"

Reading the includes-rewritten source we never exit from empty.h

if empty.h contains something, clang produces:

    # 1 "<built-in>"
    # 1 "empty.cpp"
    #if 0 /* expanded by -frewrite-includes */
    #include "empty.h"
    #endif /* expanded by -frewrite-includes */
    # 1 "empty.cpp"
    # 1 "./empty.h" 1

    # 2 "empty.cpp" 2

-- 
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