[all-commits] [llvm/llvm-project] 5616c5: [clang] Tweaked fixit for static assert with no me...

Nathan James via All-commits all-commits at lists.llvm.org
Mon Feb 22 09:44:16 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5616c5b8664b54671e699e5c45178f11cbb680b3
      https://github.com/llvm/llvm-project/commit/5616c5b8664b54671e699e5c45178f11cbb680b3
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2021-02-22 (Mon, 22 Feb 2021)

  Changed paths:
    M clang/lib/Parse/ParseDeclCXX.cpp
    A clang/test/FixIt/fixit-static-assert.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list