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

            Bug ID: 27211
           Summary: clang-format adding spaces inside filename in
                    __has_include(<FILENAME>)
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified

__has_include(<FILENAME>) may change the FILENAME (by adding spaces) if it
includes certain symbols. It will change meaning of the program. Small example:

> cat has_inc.cpp 

#if __has_include(<test/c++config.h>)
#endif

> clang-format has_inc.cpp 

#if __has_include(<test / c++ config.h>)
#endif


Real life example that triggered this problem:
https://github.com/facebook/infer/commit/bfde4054957b2fe4492f04d3724982b24aa8116f

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