Skip to content

Fix C&P issue int test of bool-likes in optional#149

Merged
akrzemi1 merged 2 commits into
boostorg:developfrom
Flamefire:patch-2
Jul 16, 2026
Merged

Fix C&P issue int test of bool-likes in optional#149
akrzemi1 merged 2 commits into
boostorg:developfrom
Flamefire:patch-2

Conversation

@Flamefire

@Flamefire Flamefire commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This was likely an omission by copying MyBool in 1fb60cb

Currently it is exactly the same so provides not further coverage
If the bool-operator should also be explicit that needs to be added too

@akrzemi1

BTW: I'd suggest switching to the reusable Boost.CI workflow There the Clang-16 failure is fixed by using the container

This was likely an omission by copying `MyBool`
Temporary workaround to make CI pass
@akrzemi1

Copy link
Copy Markdown
Member

This is to acknowledge that I see the request. I will be able to look at it within 8 hours.

@akrzemi1
akrzemi1 merged commit f221261 into boostorg:develop Jul 16, 2026
21 of 49 checks passed
@akrzemi1

Copy link
Copy Markdown
Member

BTW: I'd suggest switching to the reusable Boost.CI workflow There the Clang-16 failure is fixed by using the container

Is enough that I swap contents of this .github/workflows/ci.yml file?

@Flamefire

Flamefire commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Is enough that I swap contents of this .github/workflows/ci.yml file?

Yes. If you need customization there is a large number of inputs available.
Feel free to reach out if you need help with something specific

You might want to look int the GCC 4.8 failure which is new in this test

Error
n file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp: In instantiation of 'boost::optional<T>::optional(const boost::optional<U>&, typename boost::enable_if<boost::optional_detail::is_optional_constructible<T, const U&>, bool>::type) [with U = bool; T = MyExplicitBool; typename boost::enable_if<boost::optional_detail::is_optional_constructible<T, const U&>, bool>::type = bool]':
libs/optional/test/optional_test_constructors.cpp:134:22:   required from 'void direct_test_ctor_optional_T_from_optional_U(U) [with T = MyExplicitBool; U = bool]'
libs/optional/test/optional_test_constructors.cpp:185:53:   required from 'void test_ctor_optional_T_from_optional_U(U) [with T = MyExplicitBool; U = bool]'
libs/optional/test/optional_test_constructors.cpp:274:62:   required from here
./boost/optional/optional.hpp:672:9: error: no matching function for call to 'boost::optional<MyExplicitBool>::construct(const bool&)'
         this->construct(rhs.get());
         ^
./boost/optional/optional.hpp:672:9: note: candidates are:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:344:10: note: void boost::optional_detail::optional_base<T>::construct(boost::optional_detail::optional_base<T>::argument_type) [with T = MyExplicitBool; boost::optional_detail::optional_base<T>::argument_type = const MyExplicitBool&]
     void construct ( argument_type val )
          ^
./boost/optional/optional.hpp:344:10: note:   no known conversion for argument 1 from 'const bool' to 'boost::optional_detail::optional_base<MyExplicitBool>::argument_type {aka const MyExplicitBool&}'
./boost/optional/optional.hpp:350:10: note: void boost::optional_detail::optional_base<T>::construct(boost::optional_detail::optional_base<T>::rval_reference_type) [with T = MyExplicitBool; boost::optional_detail::optional_base<T>::rval_reference_type = MyExplicitBool&&]
     void construct ( rval_reference_type val )
          ^
./boost/optional/optional.hpp:350:10: note:   no known conversion for argument 1 from 'const bool' to 'boost::optional_detail::optional_base<MyExplicitBool>::rval_reference_type {aka MyExplicitBool&&}'
./boost/optional/optional.hpp:360:10: note: template<class ... Args> void boost::optional_detail::optional_base<T>::construct(boost::optional_ns::in_place_init_t, Args&& ...) [with Args = {Args ...}; T = MyExplicitBool]
     void construct ( in_place_init_t, Args&&... args )
          ^
./boost/optional/optional.hpp:360:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:672:9: note:   cannot convert '(& rhs)->boost::optional<T>::get<bool>()' (type 'const bool') to type 'boost::optional_ns::in_place_init_t'
         this->construct(rhs.get());
         ^
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:394:10: note: template<class Expr> void boost::optional_detail::optional_base<T>::construct(Expr&&, const boost::in_place_factory_base*) [with Expr = Expr; T = MyExplicitBool]
     void construct ( Expr&& factory, in_place_factory_base const* )
          ^
./boost/optional/optional.hpp:394:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:672:9: note:   candidate expects 2 arguments, 1 provided
         this->construct(rhs.get());
         ^
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:402:10: note: template<class Expr> void boost::optional_detail::optional_base<T>::construct(Expr&&, const boost::typed_in_place_factory_base*) [with Expr = Expr; T = MyExplicitBool]
     void construct ( Expr&& factory, typed_in_place_factory_base const* )
          ^
./boost/optional/optional.hpp:402:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:672:9: note:   candidate expects 2 arguments, 1 provided
         this->construct(rhs.get());
         ^
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:430:10: note: template<class Expr> void boost::optional_detail::optional_base<T>::construct(Expr&&, const void*) [with Expr = Expr; T = MyExplicitBool]
     void construct ( Expr&& expr, void const* )
          ^
./boost/optional/optional.hpp:430:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:672:9: note:   candidate expects 2 arguments, 1 provided
         this->construct(rhs.get());
         ^
./boost/optional/optional.hpp: In instantiation of 'boost::optional<T>::optional(boost::optional<U>&&, typename boost::enable_if<boost::optional_detail::is_optional_constructible<T, U>, bool>::type) [with U = bool; T = MyExplicitBool; typename boost::enable_if<boost::optional_detail::is_optional_constructible<T, U>, bool>::type = bool]':
libs/optional/test/optional_test_constructors.cpp:140:39:   required from 'void direct_test_ctor_optional_T_from_optional_U(U) [with T = MyExplicitBool; U = bool]'
libs/optional/test/optional_test_constructors.cpp:185:53:   required from 'void test_ctor_optional_T_from_optional_U(U) [with T = MyExplicitBool; U = bool]'
libs/optional/test/optional_test_constructors.cpp:274:62:   required from here
./boost/optional/optional.hpp:688:9: error: no matching function for call to 'boost::optional<MyExplicitBool>::construct(std::remove_reference<bool&>::type)'
         this->construct( optional_detail::move_(rhs.get()) );
         ^
./boost/optional/optional.hpp:688:9: note: candidates are:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:344:10: note: void boost::optional_detail::optional_base<T>::construct(boost::optional_detail::optional_base<T>::argument_type) [with T = MyExplicitBool; boost::optional_detail::optional_base<T>::argument_type = const MyExplicitBool&]
     void construct ( argument_type val )
          ^
./boost/optional/optional.hpp:344:10: note:   no known conversion for argument 1 from 'std::remove_reference<bool&>::type {aka bool}' to 'boost::optional_detail::optional_base<MyExplicitBool>::argument_type {aka const MyExplicitBool&}'
./boost/optional/optional.hpp:350:10: note: void boost::optional_detail::optional_base<T>::construct(boost::optional_detail::optional_base<T>::rval_reference_type) [with T = MyExplicitBool; boost::optional_detail::optional_base<T>::rval_reference_type = MyExplicitBool&&]
     void construct ( rval_reference_type val )
          ^
./boost/optional/optional.hpp:350:10: note:   no known conversion for argument 1 from 'std::remove_reference<bool&>::type {aka bool}' to 'boost::optional_detail::optional_base<MyExplicitBool>::rval_reference_type {aka MyExplicitBool&&}'
./boost/optional/optional.hpp:360:10: note: template<class ... Args> void boost::optional_detail::optional_base<T>::construct(boost::optional_ns::in_place_init_t, Args&& ...) [with Args = {Args ...}; T = MyExplicitBool]
     void construct ( in_place_init_t, Args&&... args )
          ^
./boost/optional/optional.hpp:360:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:688:9: note:   cannot convert 'boost::optional_detail::move_<bool&>((* &(& rhs)->boost::optional<T>::get<bool>()))' (type 'std::remove_reference<bool&>::type {aka bool}') to type 'boost::optional_ns::in_place_init_t'
         this->construct( optional_detail::move_(rhs.get()) );
         ^
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:394:10: note: template<class Expr> void boost::optional_detail::optional_base<T>::construct(Expr&&, const boost::in_place_factory_base*) [with Expr = Expr; T = MyExplicitBool]
     void construct ( Expr&& factory, in_place_factory_base const* )
          ^
./boost/optional/optional.hpp:394:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:688:9: note:   candidate expects 2 arguments, 1 provided
         this->construct( optional_detail::move_(rhs.get()) );
         ^
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:402:10: note: template<class Expr> void boost::optional_detail::optional_base<T>::construct(Expr&&, const boost::typed_in_place_factory_base*) [with Expr = Expr; T = MyExplicitBool]
     void construct ( Expr&& factory, typed_in_place_factory_base const* )
          ^
./boost/optional/optional.hpp:402:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:688:9: note:   candidate expects 2 arguments, 1 provided
         this->construct( optional_detail::move_(rhs.get()) );
         ^
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:430:10: note: template<class Expr> void boost::optional_detail::optional_base<T>::construct(Expr&&, const void*) [with Expr = Expr; T = MyExplicitBool]
     void construct ( Expr&& expr, void const* )
          ^
./boost/optional/optional.hpp:430:10: note:   template argument deduction/substitution failed:
In file included from libs/optional/test/optional_test_constructors.cpp:12:0:
./boost/optional/optional.hpp:688:9: note:   candidate expects 2 arguments, 1 provided
         this->construct( optional_detail::move_(rhs.get()) );
         ^

@Flamefire
Flamefire deleted the patch-2 branch July 17, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants