[clang] [clang] Support `__is_trivially_copyable(int()&)==false` (PR #81298)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 08:12:38 PST 2024


================
@@ -57,7 +57,7 @@ UNION(char[2], short) u2 = { .one = { 'a', 'b' } }; // ext-warning 3 {{'_Static_
 typedef UNION(char, short) U3; // expected-error {{static assertion failed due to requirement 'sizeof(char) == sizeof(short)': type size mismatch}} \
                                // expected-note{{evaluates to '1 == 2'}} \
                                // ext-warning 3 {{'_Static_assert' is a C11 extension}}
-typedef UNION(float, 0.5f) U4; // expected-error {{expected a type}} \
+typedef UNION(float, 0.5f) U4; // expected-error-re {{{{type name requires a specifier or qualifier|expected a type}}}} \
----------------
AaronBallman wrote:

I think there's an 'or' because the RUN lines run this in both C and C++ mode, so you get different diagnostics. A better way to express that is with a different `-verify` prefix on the RUN lines so that you can do something like `cpp-error {{blah}}` and `c-error {{blah}}` to make it more clear what's happening.

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


More information about the cfe-commits mailing list