[PATCH] D144285: [Clang] Implement CWG2518 - static_assert(false)

Jordan Rupprecht via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 13:16:49 PST 2023


rupprecht added a comment.

Here's one change this patch causes on "real" code (invalid code, but something a user might try to compile): we see is a static_assert in gmock that now fails to report a useful error message: https://godbolt.org/z/sPr1PYT9d

Previously we saw `error: static assertion failed due to requirement <...snip...>: This method does not take 2 arguments. Parenthesize all types with unprotected commas.`. It still fails to compile, but without the nice error message.

My guess, although I haven't looked too closely, is that it's due to the `static_assert(false)` here: https://github.com/google/googletest/blob/2d4f208765af7fa376b878860a7677ecc0bc390a/googlemock/include/gmock/gmock-function-mocker.h#L149


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144285



More information about the cfe-commits mailing list