[clang] Tweaked fixit for static assert with no message
authorNathan James <n.james93@hotmail.co.uk>
Mon, 22 Feb 2021 17:43:52 +0000 (17:43 +0000)
committerNathan James <n.james93@hotmail.co.uk>
Mon, 22 Feb 2021 17:43:53 +0000 (17:43 +0000)
commit5616c5b8664b54671e699e5c45178f11cbb680b3
tree91857999bcf68d47bed5fe2c099e807b3d8e0031
parent5e7e499b912d2c9ebaa91b5783ca123dbedeabcc
[clang] Tweaked fixit for static assert with no message

If a static assert has a message as the right side of an and condition, suggest a fix it of replacing the '&&' to ','.

`static_assert(cond && "Failed Cond")` -> `static_assert(cond, "Failed cond")`

This use case comes up when lazily replacing asserts with static asserts.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D89065
clang/lib/Parse/ParseDeclCXX.cpp
clang/test/FixIt/fixit-static-assert.cpp [new file with mode: 0644]