[llvm-bugs] [Bug 52558] New: clang-format inserts spaces in include path

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 19 05:54:11 PST 2021


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

            Bug ID: 52558
           Summary: clang-format inserts spaces in include path
           Product: clang
           Version: 13.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: robin.gutoehrlein at trumpf.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

If a c++ file contains the following line:

   #include <test//test.h>

(which compiles with the current microsoft c++ compiler), clang-format changes
this path to

   #include <test //test.h>

if called with 

   clang-format test.cpp > test-formatted.cpp.

It seems that clang "thinks" the double slash is a comment and inserts a space
before it, but a comment should never start in a include path.

-- 
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/20211119/06779771/attachment.html>


More information about the llvm-bugs mailing list