[clang] [clang][NFC] Refactor `clang/test/SemaCXX/type-traits.cpp` to use modern `static_assert` (PR #77584)
Amirreza Ashouri via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 12 14:12:08 PST 2024
================
@@ -2875,10 +2875,10 @@ struct __attribute__((packed)) PackedNoPadding2 {
int j;
short i;
};
-static_assert(has_unique_object_representations<PackedNoPadding1>::value, "Packed structs have no padding");
-static_assert(has_unique_object_representations<PackedNoPadding2>::value, "Packed structs have no padding");
+static_assert(__has_unique_object_representations(PackedNoPadding1), "Packed structs have no padding");
+static_assert(__has_unique_object_representations(PackedNoPadding2), "Packed structs have no padding");
-static_assert(!has_unique_object_representations<int(int)>::value, "Functions are not unique");
+static_assert(!__has_unique_object_representations(int(int)), "Functions are not unique");
static_assert(!has_unique_object_representations<int(int) const>::value, "Functions are not unique");
----------------
AMP999 wrote:
We'd like to eliminate this usage too, but the parser doesn't support it yet.
The issue is explained here: https://github.com/llvm/llvm-project/issues/77585
https://github.com/llvm/llvm-project/pull/77584
More information about the cfe-commits
mailing list