[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 08:51:52 PST 2024


================
@@ -6,20 +6,20 @@ struct A {
 };
 
 static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 5});
-static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}}
-static_assert(A{1, 2, 3, 4, 5} == A{1, 0, 3, 4, 5}); // expected-error {{failed}}
-static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 0, 4, 5}); // expected-error {{failed}}
-static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 0, 5}); // expected-error {{failed}}
-static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 0}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}} expected-note {{evaluates to}}
----------------
sethp wrote:

Actually, on second thought, I think I'd prefer to leave these under-specified (since they're really checking the behavior of the default `operator==`).

I did go ahead and add a test specifically for some more complicated types in [2fd5fc4](https://github.com/llvm/llvm-project/pull/74852/commits/2fd5fc464868a682cb4b66ea4e97a6a7100ab120) , though, to give us a few specific examples to focus on for discussion

https://github.com/llvm/llvm-project/pull/74852


More information about the cfe-commits mailing list