[PATCH] D146376: Update static_assert message for redundant cases

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 5 09:44:00 PDT 2023


aaron.ballman added a comment.

In D146376#4244355 <https://reviews.llvm.org/D146376#4244355>, @Krishna-13-cyber wrote:

> - Updated with release note
> - I had tried adding more text to the `expected-error` but it already gives a diagnostic of `static assertion failed due to requirement` currently. If I try additions to `{{failed}}` then we get **error diagnostics expected but not seen**.

Ah, sorry for being unclear! We didn't mean add an additional `expected-error` comment, but to modify the ones you have. e.g.,

Currently:

  static_assert(true && false, ""); // expected-error {{failed}}

Changes to:

  static_assert(true && false, ""); // expected-error {{static assertion failed due to requirement 'true && false'}}

(or whatever the actual expected full text of the diagnostic is.)

This helps the reviewers to make sure that the diagnostic behavior isn't regressing in surprising ways but pass all our tests because we're only looking for the word `failed` and considering that passing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146376/new/

https://reviews.llvm.org/D146376



More information about the cfe-commits mailing list