X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Fconfig%2Ftest%2Fboost_no_cxx14_constexpr.ipp;h=cc6552700e5abf596412ff83fee6246950071e9e;hb=b32b81446b3b05102be0267e79203f59329c1d97;hp=5dd43dfae9b831cfdec1dd834c54f944ad3f5272;hpb=215dd7151453fae88e6f968c975b6ce309d42dcf;p=ceph.git diff --git a/ceph/src/boost/libs/config/test/boost_no_cxx14_constexpr.ipp b/ceph/src/boost/libs/config/test/boost_no_cxx14_constexpr.ipp index 5dd43dfae..cc6552700 100644 --- a/ceph/src/boost/libs/config/test/boost_no_cxx14_constexpr.ipp +++ b/ceph/src/boost/libs/config/test/boost_no_cxx14_constexpr.ipp @@ -1,5 +1,5 @@ -// (C) Copyright Kohei Takahashi 2014 +// (C) Copyright Kohei Takahashi 2014,2016 // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file @@ -17,6 +17,15 @@ namespace boost_no_cxx14_constexpr namespace detail { template struct void_ { typedef void type; }; + + struct non_tmpl + { + constexpr int foo() const { return 1; } + constexpr int foo() { return 0; } + }; + + template + struct tmpl : non_tmpl { }; } // Test relaxed constexpr with dependent type; for more details, see comment of @@ -27,6 +36,17 @@ constexpr typename detail::void_::type decrement(T &value) --value; } +constexpr int non_cv_member(detail::non_tmpl x) +{ + return x.foo(); +} + +template +constexpr int non_cv_member(detail::tmpl x) +{ + return x.foo(); +} + constexpr int zero() { int ret = 1; @@ -34,9 +54,18 @@ constexpr int zero() return ret; } +template struct compile_time_value +{ + static constexpr int value = v; +}; + int test() { - return zero(); + return compile_time_value< + zero() + + non_cv_member(detail::non_tmpl()) + + non_cv_member(detail::tmpl()) + >::value; } }