[libcxx] r224298 - Once more w/o the typo.

Marshall Clow mclow.lists at gmail.com
Mon Dec 15 16:46:23 PST 2014


Author: marshall
Date: Mon Dec 15 18:46:23 2014
New Revision: 224298

URL: http://llvm.org/viewvc/llvm-project?rev=224298&view=rev
Log:
Once more w/o the typo.

Modified:
    libcxx/trunk/test/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp

Modified: libcxx/trunk/test/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp?rev=224298&r1=224297&r2=224298&view=diff
==============================================================================
--- libcxx/trunk/test/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp (original)
+++ libcxx/trunk/test/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp Mon Dec 15 18:46:23 2014
@@ -9,7 +9,7 @@
 
 // <optional>
 
-// T* optional<T>::operator->();
+// constexpr T* optional<T>::operator->();
 
 #ifdef _LIBCPP_DEBUG
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
@@ -25,8 +25,7 @@ using std::experimental::optional;
 
 struct X
 {
-    int test() const {return 2;}
-    int test() {return 3;}
+    constexpr int test() {return 3;}
 };
 
 #endif  // _LIBCPP_STD_VER > 11
@@ -35,8 +34,8 @@ int main()
 {
 #if _LIBCPP_STD_VER > 11
     {
-        optional<X> opt(X{});
-        assert(opt->test() == 3);
+        constexpr optional<X> opt(X{});
+        static_assert(opt->test() == 3, "");
     }
 #ifdef _LIBCPP_DEBUG
     {





More information about the cfe-commits mailing list