This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Remove use of default function template parameters in type traits. Fixes DR20484
ClosedPublic

Authored by EricWF on Jul 30 2014, 6:26 PM.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 12052.Jul 30 2014, 6:26 PM
EricWF retitled this revision from to Remove use of default function template parameters in type traits. Fixes DR20484.
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, danalbert.
EricWF set the repository for this revision to rL LLVM.
EricWF added a subscriber: Unknown Object (MLST).
EricWF retitled this revision from Remove use of default function template parameters in type traits. Fixes DR20484 to [libcxx] Remove use of default function template parameters in type traits. Fixes DR20484.Jul 30 2014, 6:38 PM
K-ballo added inline comments.
include/type_traits
1554

Isn't the decltype still a problem if it has to compile in C++03 mode?

decltype is #defined to __typeof__ when it is not available (ie. c++03 mode). The other uses of decltype in the type_traits header lead me to believe it should not be a problem. The tests for <cmath> (as en example since it includes <type_traits>) compile after this change in C++03 mode (for GCC tot) but not before.

danalbert accepted this revision.Jul 30 2014, 8:22 PM
danalbert edited edge metadata.

LGTM.

I can test this against the projects we had that were failing tomorrow if you'd like.

This revision is now accepted and ready to land.Jul 30 2014, 8:22 PM

@danalbert I would appreciate that. I wouldn't mind your verification since this needs to get merged into 3.5 on short notice.

@mclow.lists I'm going to wait on your OK as well before I commit this.

mclow.lists edited edge metadata.EditedJul 31 2014, 7:13 AM

I tested this in C++03/11/14 modes. All tests passed in 11/14, but the is_destructible tests failed in C++03 mode (as they did before this change), due to the fact that __typeof__ is not really a replacement for declval.

This looks OK to me.

include/type_traits
1554

Yes. It will fail (cause a compilation failure) when the destructor is private or protected.

Well, I still can't get a passing checkbuild (though I can build a system image) with ToT libc++, but it's a different set of issues now (partially due to bugs in our version of gcc). I think this patch is good to go.

EricWF closed this revision.Jul 31 2014, 12:18 PM