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

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 18 03:31:01 PST 2021


ChuanqiXu added a comment.

There could be more tests in case we want support c++20 module more. This shouldn't be a break issue for this patch since this aims to fix the space in partitions only.

  export template<...>;
  export struct {
    ...
  };
  export int func() {
     // ...
  }
  export using A = B;
  template<...>
  export using A = B<T>;
  export {
  
  };
  export type_name var;

Feel free to ignore this if you want to support them in later patches.

Thanks!



================
Comment at: clang/docs/ReleaseNotes.rst:231
 
+- Improved Cpp20 Modules support
+
----------------



================
Comment at: clang/unittests/Format/FormatTest.cpp:22406
+  verifyFormat("export module foo:bar;", Style);
+  verifyFormat("export module foo;", Style);
+
----------------
The module name could contain dot '.' in the middle. Although it seems like wouldn't be broken by clang-format, I think it is better to test it.


================
Comment at: clang/unittests/Format/FormatTest.cpp:22411
+  verifyFormat("import bar;", Style);
+  verifyFormat("import <ctime>;", Style);
+
----------------
It lacks a test for `import "header";`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114151/new/

https://reviews.llvm.org/D114151



More information about the cfe-commits mailing list