[all-commits] [llvm/llvm-project] 11d793: [clang-format] Keep C++20 module/import decls on a...

owenca via All-commits all-commits at lists.llvm.org
Fri Jun 5 22:03:39 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 11d7939060e874cdc8378e2b711c719b0d4ba8e1
      https://github.com/llvm/llvm-project/commit/11d7939060e874cdc8378e2b711c719b0d4ba8e1
  Author: owenca <owenpiano at gmail.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/lib/Format/TokenAnnotator.h
    M clang/lib/Format/UnwrappedLineParser.cpp
    M clang/lib/Format/UnwrappedLineParser.h
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [clang-format] Keep C++20 module/import decls on a single line (#199459)

This patch fixes #193676.

- Added `UnwrappedLineParser::parseModuleDecl()` to parse C++20 module
declarations.
- Adapted `parseCppModuleImport()` from #193834 and renamed it to
`parseImportDecl()`.
- Used the test cases from the same PR.
- Removed the invalid test cases and fixed an incorrect one in
`FormatTest.cpp`.

---------

Co-authored-by: Björn Schäpers <github at hazardy.de>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list