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 crashes on invalid C++ code with requires #54350

Closed
owenca opened this issue Mar 12, 2022 · 4 comments
Closed

clang-format crashes on invalid C++ code with requires #54350

owenca opened this issue Mar 12, 2022 · 4 comments
Assignees
Labels
clang-format crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@owenca
Copy link
Contributor

owenca commented Mar 12, 2022

clang-format crashes when formatting clang/test/Parser/cxx2a-concepts-requires-expr.cpp, which can be reduced to a single line (of invalid C++ code) as shown below:

~$ ls .clang-format
ls: .clang-format: No such file or directory
~$ ./clang-format -version
clang-format version 15.0.0 (https://github.com/llvm/llvm-project 9f616a467fc710f084b7e57812a2ed64c214c2c6)
~$ ./clang-format
bool r10 = requires (struct new_struct { int x; } s) { requires true; };
Assertion failed: ((!TypeIsFinalized || T == Type) && "Please use overwriteFixedType to change a fixed type."), function setType, file FormatToken.h, line 351.
...
@owenca owenca added clang-format crash Prefer [crash-on-valid] or [crash-on-invalid] labels Mar 12, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 12, 2022

@llvm/issue-subscribers-clang-format

@owenca
Copy link
Contributor Author

owenca commented Mar 12, 2022

@HazardyKnusperkeks, can you have a look? #54349 may or may not be related.

@HazardyKnusperkeks HazardyKnusperkeks self-assigned this Mar 12, 2022
@HazardyKnusperkeks
Copy link
Contributor

Will do.

@HazardyKnusperkeks
Copy link
Contributor

Review: https://reviews.llvm.org/D121550

@HazardyKnusperkeks HazardyKnusperkeks added the awaiting-review Has pending Phabricator review label Mar 13, 2022
@github-actions github-actions bot removed the awaiting-review Has pending Phabricator review label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang-format crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

3 participants