[PATCH] D114151: [clang-format] [C++20] [Module] clang-format couldn't recognize partitions

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 18 03:12:27 PST 2021


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: HazardyKnusperkeks, curdeius, owenpan, ChuanqiXu.
MyDeveloperDay added projects: clang, clang-format.
Herald added subscribers: jrtc27, arichardson.
MyDeveloperDay requested review of this revision.

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

clang-format is butchering modules, this could easily become a barrier to entry for modules given clang-formats wide spread use.

Prevent the following from adding spaces around the  `:`  (cf was considering the ':' as an InheritanceColon)

  import <ctime>;
  import foo:bar;
  import :bar;
  export module foo:bar;
  export import foo:bar;
  export import :bar;
  module foo:bar;

to

  import<ctime>;
  import foo : bar;
  import : bar;
  export module foo : bar;
  export import foo : bar;
  export import : bar;
  module foo : bar;


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114151

Files:
  clang/docs/ReleaseNotes.rst
  clang/lib/Format/FormatToken.h
  clang/lib/Format/TokenAnnotator.cpp
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114151.388145.patch
Type: text/x-patch
Size: 4696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211118/8e6fe11d/attachment.bin>


More information about the cfe-commits mailing list