From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/proto/test/bug2407.cpp | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/boost/libs/proto/test/bug2407.cpp (limited to 'src/boost/libs/proto/test/bug2407.cpp') diff --git a/src/boost/libs/proto/test/bug2407.cpp b/src/boost/libs/proto/test/bug2407.cpp new file mode 100644 index 00000000..c67bd55c --- /dev/null +++ b/src/boost/libs/proto/test/bug2407.cpp @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////// +// bug2407.hpp +// +// Copyright 2008 Eric Niebler. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +namespace mpl = boost::mpl; +namespace proto = boost::proto; +using proto::_; + +template +struct e; + +struct g + : proto::or_< + proto::terminal + , proto::plus + > +{}; + +struct d + : proto::domain, g> +{}; + +template +struct e + : proto::extends, d> +{ + BOOST_MPL_ASSERT((proto::matches)); + + e(E const &x = E()) + : proto::extends, d>(x) + {} +}; + +e::type> i; + +template +std::ostream &operator<<(std::ostream &sout, e const &x) +{ + return sout; +} + +int main() +{ + std::cout << (i+i); +} -- cgit v1.2.3