[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
Wed Apr 19 10:16:59 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG33e21610f9cd: [clang] makes `__is_trivially_equality_comparable` available as a struct (authored by cjdb).

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.515010.patch
Type: text/x-patch
Size: 1441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230419/2fc2015a/attachment.bin>


More information about the cfe-commits mailing list