From d2f095e5bab4c2df2d94e1d0f4e7637f35a828f6 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Sat, 5 Oct 2013 23:29:16 +0000 Subject: Add tests making sure that optionals can be compared at compile time; this functionality was enabled by N3789 llvm-svn: 192051 --- .../utilities/optional/optional.relops/equal.pass.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libcxx/test/utilities/optional/optional.relops/equal.pass.cpp') diff --git a/libcxx/test/utilities/optional/optional.relops/equal.pass.cpp b/libcxx/test/utilities/optional/optional.relops/equal.pass.cpp index ec0503c39ba..a600d07ecbe 100644 --- a/libcxx/test/utilities/optional/optional.relops/equal.pass.cpp +++ b/libcxx/test/utilities/optional/optional.relops/equal.pass.cpp @@ -15,11 +15,25 @@ #include #include +#if _LIBCPP_STD_VER > 11 + +struct X +{ + int i_; + + constexpr X(int i) : i_(i) {} +}; + +constexpr bool operator == ( const X &rhs, const X &lhs ) + { return rhs.i_ == lhs.i_ ; } + +#endif + int main() { #if _LIBCPP_STD_VER > 11 { - typedef int T; + typedef X T; typedef std::optional O; constexpr O o1; // disengaged -- cgit v1.2.3