[clang] [clang-format] Don't break module names (PR #193834)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 24 03:25:40 PDT 2026


================
@@ -24630,8 +24625,22 @@ TEST_F(FormatTest, Cpp20ModulesSupport) {
   verifyFormat("module", Style);
   verifyFormat("export", Style);
 
+  Style.ColumnLimit = 10;
+  verifyFormat("import Foo.Bar;", Style);
+  verifyFormat("export import Foo.Bar;", Style);
+  verifyFormat("export module Foo.Bar;", Style);
+  verifyFormat("import Foo.Bar:Baz;", Style);
+  verifyFormat("export import Foo.Bar:Baz;", Style);
+  verifyFormat("export module Foo.Bar:Baz;", Style);
----------------
HazardyKnusperkeks wrote:

That is neither accepted from clang nor GCC. All those export and import stuff has to be on the same line.

https://github.com/llvm/llvm-project/pull/193834


More information about the cfe-commits mailing list