[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
Tue Mar 5 01:31:14 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:

By merging #81298 into the `main` branch, the elimination is now possible and it has been done in commit `2018c5a`.

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


More information about the cfe-commits mailing list