This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix detection of __is_final.
ClosedPublic

Authored by EricWF on Apr 1 2015, 7:37 PM.

Details

Summary

Currently we only enable the use of is_final(...) with Clang. GCC also provides is_final(...) since 4.7 in all standard modes. This patch creates the macro _LIBCPP_HAS_IS_FINAL to note the availability of __is_final.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 23115.Apr 1 2015, 7:37 PM
EricWF retitled this revision from to [libcxx] Fix detection of __is_final..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, danalbert.
EricWF added a subscriber: Unknown Object (MLST).

Ping. Libc++ can't be used with GCC until this lands.

EricWF updated this revision to Diff 26005.May 18 2015, 1:16 PM

Change all occurrences of __is_final(Tp) to use is_final<Tp>::value.

Perhaps we should use _LIBCPP_HAS_NO_IS_FINAL instead of _LIBCPP_HAS_IS_FINAL?

EricWF updated this revision to Diff 26098.May 19 2015, 3:25 PM

Only expose is_tuple in C++14 and beyond. Create and internally use __libcpp_is_final in all other standard modes.

mclow.lists edited edge metadata.May 20 2015, 7:19 AM

What do you think of making __libcpp_is_final be false when we don't have __is_final.

Then the #if in unordered_map, memory, map, etc. can be removed.

EricWF updated this revision to Diff 26302.May 21 2015, 7:35 PM
EricWF edited edge metadata.

Address @mclow.list's review comments. Default __libcpp_is_final to false when we don't have the intrinsics and remove the preprocessor blocks around its usage.

Any more comments on this patch?

mclow.lists accepted this revision.May 31 2015, 7:10 AM
mclow.lists edited edge metadata.

LGTM.

This revision is now accepted and ready to land.May 31 2015, 7:10 AM
EricWF closed this revision.Jun 13 2015, 12:12 AM