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:
@@ -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), "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user