This patch moves the SFINAE for __is_destructor_welformed out of the function template parameters. type_traits must compile in c++03 mode since it is included in c++03 headers.
Details
- Reviewers
mclow.lists danalbert - Commits
- rGb0ca78fb5148: [libcxx] Remove use of default function template parameters in type traits.
rG6d3bd8f7ec0e: [libcxx] Remove use of default function template parameters in type traits.
rCXX214422: [libcxx] Remove use of default function template parameters in type traits.
rL214427: [libcxx] Remove use of default function template parameters in type traits.
rL214422: [libcxx] Remove use of default function template parameters in type traits.
Diff Detail
Event Timeline
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.
LGTM.
I can test this against the projects we had that were failing tomorrow if you'd like.
@danalbert I would appreciate that. I wouldn't mind your verification since this needs to get merged into 3.5 on short notice.
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.
Isn't the decltype still a problem if it has to compile in C++03 mode?