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 removes spaces between throw and cast #57391

Closed
alanzhao1 opened this issue Aug 26, 2022 · 2 comments
Closed

clang-format removes spaces between throw and cast #57391

alanzhao1 opened this issue Aug 26, 2022 · 2 comments
Assignees

Comments

@alanzhao1
Copy link
Contributor

alanzhao1 commented Aug 26, 2022

First reported in Chromium: https://crbug.com/1018187

Repro steps:

$ cat test_throw.cpp
void foo(int x) { throw (long) x; }

$ clang-format test_throw.cpp

Expected behavior:
clang-format should not remove the space before throw and (long)

Actual behavior:

void foo(int x) { throw(long) x; }

It seems that clang-format is treating throw (long) as a function-style construct instead of a cast.

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 26, 2022

@llvm/issue-subscribers-clang-format

@rymiel
Copy link
Member

rymiel commented Aug 26, 2022

Differential: https://reviews.llvm.org/D132762

@owenca owenca added the awaiting-review Has pending Phabricator review label Aug 28, 2022
@github-actions github-actions bot removed the awaiting-review Has pending Phabricator review label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants