[libcxx-commits] [PATCH] D80482: [libcxx] Fix C++14 and up constexpr members in MoveOnly.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 25 08:33:45 PDT 2020


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/test/support/MoveOnly.h:36
     constexpr bool operator< (const MoveOnly& x) const {return data_ <  x.data_;}
-    constexpr MoveOnly operator+(const MoveOnly& x) const { return MoveOnly{data_ + x.data_}; }
-    constexpr MoveOnly operator*(const MoveOnly& x) const { return MoveOnly{data_ * x.data_}; }
+    TEST_CONSTEXPR_CXX14 MoveOnly operator+(const MoveOnly& x) const
+        { return MoveOnly{data_ + x.data_}; }
----------------
I think those should be OK in C++11, no? It's only a single return statement.


================
Comment at: libcxx/test/support/MoveOnly.h:39
+    TEST_CONSTEXPR_CXX14 MoveOnly operator*(const MoveOnly& x) const
+        { return MoveOnly{data_ * x.data_}; }
 };
----------------
Same


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80482





More information about the libcxx-commits mailing list