Opened 7 years ago

Closed 7 years ago

#11449 closed Bugs (fixed)

[C++11] is_polymorphic doesn't work with final-ed class in MSVC.

Reported by: Kohei Takahashi <flast@…> Owned by: John Maddock
Milestone: Boost 1.60.0 Component: type_traits
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Following code don't compile in MSVC 12 and 14 RC: I didn't test with other versions.

#include <type_traits>
#include <boost/type_traits/is_polymorphic.hpp>

struct S final {};

int main()
{
        static_assert(!std::is_polymorphic<S>::value, "S should not be a polymorphic type"); // works fine
        static_assert(boost::is_polymorphic<final>::value, "hmm..."); // hard error
}

The error message says:

'boost::detail::is_polymorphic_impl1<T>::d1' cannot derive from 'S' because it is declared as 'final'.

Attachments (1)

66bfcbfd052b0b94e6fe284d4a2ac78a.png (64.0 KB ) - added by Kohei Takahashi <flast@…> 7 years ago.

Download all attachments as: .zip

Change History (3)

by Kohei Takahashi <flast@…>, 7 years ago

comment:1 by John Maddock, 7 years ago

Confirmed.

comment:2 by John Maddock, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0
Resolution: fixed
Status: newclosed

Fixed in https://github.com/boostorg/type_traits/commit/04a8a9ecc2b02b7334a4b3f0459a5f62b855cc68

Note this patch will almost certainly not make the next release.

Note: See TracTickets for help on using tickets.