Fix PR26103 - Error calling is_convertible with incomplete type. Patch from Michael Daniels.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-01-26 20:24:30 +00:00
parent 73de880a44
commit e01f946792
2 changed files with 9 additions and 2 deletions

View File

@@ -52,6 +52,11 @@ class NonCopyable {
NonCopyable(NonCopyable&);
};
template <typename T>
class CannotInstantiate {
enum { X = T::ThisExpressionWillBlowUp };
};
int main()
{
// void
@@ -206,4 +211,7 @@ int main()
test_is_not_convertible<NonCopyable&, NonCopyable>();
#endif
// Ensure that CannotInstantiate is not instantiated by is_convertible when it is not needed.
// For example CannotInstantiate is instatiated as a part of ADL lookup for arguments of type CannotInstantiate*.
static_assert((std::is_convertible<CannotInstantiate<int>*, CannotInstantiate<int>*>::value), "");
}