Opened 7 years ago

Closed 5 years ago

#12027 closed Bugs (wontfix)

is_base_of<B, D> should work ehen B is incomplete

Reported by: akrzemi1 Owned by: John Maddock
Milestone: To Be Determined Component: type_traits
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

The Standard ([meta.rel]) requires that in is_base_of<B, D> D must be a complete type, but it does not require the same of B. This makes sense, because if we compare a complete type D and an incomplete type B, the former is surely not derived from the latter.

In contrast, boost::is_base_of imposes an additional constraint that B must also be complete:

http://www.boost.org/doc/libs/1_60_0/libs/type_traits/doc/html/boost_typetraits/reference/is_base_of.html

Can you remove this extra constraint? It appears to be spoiling one Boost.Optional tests:

http://www.boost.org/development/tests/master/developer/output/oracle-sparc-S2-12-5-cpp11-boost-bin-v2-libs-optional-test-optional_test-test-sun-12-5_cpp11-release-threading-multi.html

Change History (2)

comment:1 by Mike <vigorous.activity@…>, 6 years ago

Checked 1.55 boost version, works with incomplete B.

comment:2 by John Maddock, 5 years ago

Resolution: wontfix
Status: newclosed

I've been having a look at this and:

  • There is no restriction on B being complete as long as we have a working compiler intrinsic that supports this.
  • The Oracle compiler supports the __oracle_is_base_of intrinsic, but it's use is even more restricted/broken. So we don't use it, as it makes things even worse than they are already.

Sorry, but I don't see any easy way to fix this.

Note: See TracTickets for help on using tickets.