[libcxx-commits] [PATCH] D135469: [libc++] <type_traits>: Avoid instantiating a pointer type.

John Baldwin via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 21 14:34:47 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG26068c6e6032: [libc++] <type_traits>: Avoid instantiating a pointer type. (authored by bsdjhb).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135469/new/

https://reviews.llvm.org/D135469

Files:
  libcxx/include/__type_traits/decay.h
  libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp


Index: libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
===================================================================
--- libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
+++ libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
@@ -29,10 +29,14 @@
     test_decay<int, int>();
     test_decay<const volatile int, int>();
     test_decay<int*, int*>();
+    test_decay<int&, int>();
+    test_decay<const volatile int&, int>();
     test_decay<int[3], int*>();
     test_decay<const int[3], const int*>();
     test_decay<void(), void (*)()>();
 #if TEST_STD_VER > 11
+    test_decay<int&&, int>();
+    test_decay<const volatile int&&, int>();
     test_decay<int(int) const, int(int) const>();
     test_decay<int(int) volatile, int(int) volatile>();
     test_decay<int(int)  &, int(int)  &>();
Index: libcxx/include/__type_traits/decay.h
===================================================================
--- libcxx/include/__type_traits/decay.h
+++ libcxx/include/__type_traits/decay.h
@@ -42,7 +42,7 @@
     typedef _LIBCPP_NODEBUG typename conditional
                      <
                          is_array<_Up>::value,
-                         __remove_extent_t<_Up>*,
+                         __add_pointer_t<__remove_extent_t<_Up> >,
                          typename conditional
                          <
                               is_function<_Up>::value,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135469.477005.patch
Type: text/x-patch
Size: 1458 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221121/062c2ab3/attachment.bin>


More information about the libcxx-commits mailing list