Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang-format inserts spaces in include path #51525

Open Quuxplusone opened 2 years ago

Quuxplusone commented 2 years ago
Bugzilla Link PR52558
Status NEW
Importance P enhancement
Reported by Robin Gutöhrlein (robin.gutoehrlein@trumpf.com)
Reported on 2021-11-19 05:54:11 -0800
Last modified on 2021-11-19 05:54:11 -0800
Version 13.0
Hardware PC Windows NT
CC djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
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.