[PATCH] D140339: [clang-format] Remove special logic for parsing concept definitions.
Emilia Dreamer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 5 19:13:58 PST 2023
rymiel marked an inline comment as done.
rymiel added inline comments.
================
Comment at: clang/unittests/Format/FormatTest.cpp:23593-23594
- "template <typename T>\n"
- "concept DelayedCheck = static_cast<bool>(0) ||\n"
- " requires(T t) { t.bar(); } && sizeof(T) <= 8;");
----------------
owenpan wrote:
> What would happen with parentheses added?
> ```
> concept DelayedCheck = (static_cast<bool>(0) || requires(T t) { t.bar(); }) && sizeof(T) <= 8;
> concept DelayedCheck = static_cast<bool>(0) || (requires(T t) { t.bar(); } && sizeof(T) <= 8);
> ```
No difference:
```
concept DelayedCheck =
(static_cast<bool>(0) || requires(T t) { t.bar(); }) && sizeof(T) <= 8;
concept DelayedCheck =
static_cast<bool>(0) || (requires(T t) { t.bar(); } && sizeof(T) <= 8);
concept DelayedCheck =
static_cast<bool>(0) || requires(T t) { t.bar(); } && sizeof(T) <= 8;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140339/new/
https://reviews.llvm.org/D140339
More information about the cfe-commits
mailing list