[llvm-bugs] [Bug 26771] New: -frewrite-includes: Lack of an exit line directive in case of an empty header

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 29 05:34:20 PST 2016


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: unassignedclangbugs at nondot.org
          Reporter: eugvelesevich at gmail.com
                CC: llvm-bugs at lists.llvm.org
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160229/419c948e/attachment.html>


More information about the llvm-bugs mailing list