History log of /external/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
933afa9761c1c1f916161278a99284d50a594939 04-Jul-2013 Marshall Clow <mclow.lists@gmail.com> Patch for N3655 (Transformation type traits) with Howard's additions

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
11a50ac49798c0c6dec9252b1591230e0e572017 02-Apr-2013 Howard Hinnant <hhinnant@apple.com> Richard Smith: It was pointed out to me off-list that libc++'s non-compiler-builtin
implementation of std::is_polymorphic does this:

template <class _Tp> struct __is_polymorphic1 : public _Tp {};

... and that g++ rejects this if _Tp has an inaccessible virtual destructor
(because __is_polymorphic1<_Tp> would have a deleted virtual destructor
overriding _Tp's non-deleted destructor). Clang was failing to reject this;
I've fixed that in r178563, but that causes libc++'s corresponding test
case to fail with both clang and gcc when using the fallback
implementation. The fallback code also incorrectly rejects final types.

The attached patch fixes the fallback implementation of is_polymorphic; we
now use dynamic_cast's detection of polymorphic class types rather than
trying to determine if adding a virtual function makes the type larger:

enable_if<sizeof((_Tp*)dynamic_cast<const volatile
void*>(declval<_Tp*>())) != 0, ...>

Two things of note here:
* the (_Tp*) cast is necessary to work around bugs in Clang and g++ where
we otherwise don't instantiate the dynamic_cast (filed as PR15656)
* the 'const volatile' is here to treat is_polymorphic<cv T> as true for a
polymorphic class type T -- my reading of the standard suggests this is
incorrect, but it matches our builtin __is_polymorphic and gcc


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
b64f8b07c104c6cc986570ac8ee0ed16a9f23976 16-Nov-2010 Howard Hinnant <hhinnant@apple.com> license change

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
c52f43e72dfcea03037729649da84c23b3beb04a 22-Aug-2010 Howard Hinnant <hhinnant@apple.com> Fixing whitespace problems

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@111767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
f5256e16dfc425c1d466f6308d4026d529ce9e0b 11-May-2010 Howard Hinnant <hhinnant@apple.com> Wiped out some non-ascii characters that snuck into the copyright.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
bc8d3f97eb5c958007f2713238472e0c1c8fe02c 11-May-2010 Howard Hinnant <hhinnant@apple.com> libcxx initial import

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp