Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#11904 closed Bugs (fixed)

is_nothrow_move_constructible does not compile on GCC 4.6

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

Description

Tests is_nothrow_move_constructible_test and is_nothrow_move_constructible_test_no_intrinsics fail in branch Develop on tester igaztanaga-gcc-4.6c++11 (and also igaztanaga-gcc-4.7c++11).

By "fail" I mean that the trait returns neither true nor false, but simply fails the compilation. This in turn causes failures in Boost.Optional.

Change History (4)

comment:1 by John Maddock, 7 years ago

I don't know how to fix this - those GCC versions fail inside the noexcept expression when the class being tested has a private assignment operator or copy constructor. There appear to be no compiler intrinsics available for those GCC versions either. So I'm stuck.

BTW I don't believe this ever worked, but I could be wrong?

in reply to:  1 comment:2 by akrzemi1, 7 years ago

Replying to johnmaddock:

I don't know how to fix this - those GCC versions fail inside the noexcept expression when the class being tested has a private assignment operator or copy constructor. There appear to be no compiler intrinsics available for those GCC versions either. So I'm stuck.

I understand the difficulty. Is it possible to isolate the offending compiler versions and provide a trivial definition of the trait for them? I can see it is not easy as the traits seam to work for other testers with GCC 4.6.

BTW I don't believe this ever worked, but I could be wrong?

I cannot be sure. But I thing these errors weren't there in Boost.Optional. Perhaps these testers are new.

comment:3 by John Maddock, 7 years ago

Resolution: fixed
Status: newclosed

OK, I've basically disabled these two traits for older gcc versions - see https://github.com/boostorg/type_traits/commit/1f3a3a1553dc316ed002354dce3ba3f081b2e102 - note that this introduces new failures as all UDT's now report false with these traits for gcc < 4.8, this is safe but obviously sub-optimal.

comment:4 by John Maddock, 5 years ago

Update: in response to https://github.com/boostorg/variant/issues/47 I've tentatively re-enabled support for is_nothrow_move_constructible in gcc-4.7. Tests all pass locally, so we'll see.

Note: See TracTickets for help on using tickets.