[PATCH] D148677: [clang] makes `__is_trivially_equality_comparable` available as a struct
Christopher Di Bella via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 18 18:02:16 PDT 2023
cjdb updated this revision to Diff 514798.
cjdb added a comment.
uploads the right test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148677/new/
https://reviews.llvm.org/D148677
Files:
clang/lib/Parse/ParseDeclCXX.cpp
clang/test/SemaCXX/libcxx_is_trivially_equality_comparable_hack.cpp
Index: clang/test/SemaCXX/libcxx_is_trivially_equality_comparable_hack.cpp
===================================================================
--- /dev/null
+++ clang/test/SemaCXX/libcxx_is_trivially_equality_comparable_hack.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++20 -fms-extensions -Wno-microsoft %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++2b -fms-extensions -Wno-microsoft %s
+
+template <class T, class U>
+struct Same {
+ static constexpr auto value = __is_same(T, U);
+};
+
+template <class T>
+struct __is_trivially_equality_comparable { // expected-warning{{keyword '__is_trivially_equality_comparable' will be made available as an identifier for the remainder of the translation unit}}
+ using type = T;
+};
+
+using A = Same<__is_trivially_equality_comparable<int>::type, __is_trivially_equality_comparable<int>::type>;
Index: clang/lib/Parse/ParseDeclCXX.cpp
===================================================================
--- clang/lib/Parse/ParseDeclCXX.cpp
+++ clang/lib/Parse/ParseDeclCXX.cpp
@@ -1622,6 +1622,7 @@
tok::kw___is_signed,
tok::kw___is_standard_layout,
tok::kw___is_trivial,
+ tok::kw___is_trivially_equality_comparable,
tok::kw___is_trivially_assignable,
tok::kw___is_trivially_constructible,
tok::kw___is_trivially_copyable,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148677.514798.patch
Type: text/x-patch
Size: 1441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230419/f7e9da56/attachment-0001.bin>
More information about the cfe-commits
mailing list