Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-format] [C++20] [Modules] Unexpected/Uncontrollable indentation for export block #121723

Open
ChuanqiXu9 opened this issue Jan 6, 2025 · 4 comments · May be fixed by #110381
Open

[clang-format] [C++20] [Modules] Unexpected/Uncontrollable indentation for export block #121723

ChuanqiXu9 opened this issue Jan 6, 2025 · 4 comments · May be fixed by #110381

Comments

@ChuanqiXu9
Copy link
Member

ChuanqiXu9 commented Jan 6, 2025

Reproducer:

export module a;
export {
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(int xxxxxxxxxxxxxxxxxxxxxxx, int xxxxxxxxxxxxxxx);
}

after format we got:

export module a;
export {
  int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      int xxxxxxxxxxxxxxxxxxxxxxx, int xxxxxxxxxxxxxxx);
}

But we don't want the indentation. Or we hope we can control the behavior by an option like NamespaceIndentation (https://clang.llvm.org/docs/ClangFormatStyleOptions.html#namespaceindentation)


Expected output:

export module a;
export {
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    int xxxxxxxxxxxxxxxxxxxxxxx, int xxxxxxxxxxxxxxx);
}
@ChuanqiXu9 ChuanqiXu9 added clang-format clang:modules C++20 modules and Clang Header Modules labels Jan 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 6, 2025

@llvm/issue-subscribers-clang-modules

Author: Chuanqi Xu (ChuanqiXu9)

Reproducer:
export module a;
export {
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(int xxxxxxxxxxxxxxxxxxxxxxx, int xxxxxxxxxxxxxxx);
}

after format we got:

export module a;
export {
  int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      int xxxxxxxxxxxxxxxxxxxxxxx, int xxxxxxxxxxxxxxx);
}

But we don't want the indentation. Or we hope we can control the behavior by an option like NamespaceIndentation (https://clang.llvm.org/docs/ClangFormatStyleOptions.html#namespaceindentation)

@llvmbot
Copy link
Member

llvmbot commented Jan 6, 2025

@llvm/issue-subscribers-clang-format

Author: Chuanqi Xu (ChuanqiXu9)

Reproducer:
export module a;
export {
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(int xxxxxxxxxxxxxxxxxxxxxxx, int xxxxxxxxxxxxxxx);
}

after format we got:

export module a;
export {
  int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      int xxxxxxxxxxxxxxxxxxxxxxx, int xxxxxxxxxxxxxxx);
}

But we don't want the indentation. Or we hope we can control the behavior by an option like NamespaceIndentation (https://clang.llvm.org/docs/ClangFormatStyleOptions.html#namespaceindentation)

@owenca
Copy link
Contributor

owenca commented Jan 6, 2025

What's your expected output?

@ChuanqiXu9
Copy link
Member Author

What's your expected output?

Sorry. Updated now. The key point is, I don't want the indentation for every declaration in export { block. It is ugly.

@owenca owenca removed the clang:modules C++20 modules and Clang Header Modules label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants