mirror of
https://github.com/boostorg/container.git
synced 2026-02-23 15:42:17 +00:00
Protect CTAD from old clang compilers that suffer from ICE
This commit is contained in:
@@ -307,24 +307,31 @@ bool do_test()
|
||||
if(!test::CheckEqualContainers(cntc, stdc)) return 1;
|
||||
}
|
||||
|
||||
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
|
||||
//Check Constructor Template Auto Deduction
|
||||
{
|
||||
auto gold = MyStd{ 1, 2, 3 };
|
||||
auto test = deque(gold.begin(), gold.end());
|
||||
if(!test::CheckEqualContainers(gold, test)) return false;
|
||||
}
|
||||
{
|
||||
auto gold = MyStd{ 1, 2, 3 };
|
||||
auto test = deque(gold.begin(), gold.end(), new_allocator<int>());
|
||||
if(!test::CheckEqualContainers(gold, test)) return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
std::cout << std::endl << "Test OK!" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool test_ctad() //Older clang versions suffer from ICE here
|
||||
#if !defined(BOOST_CONTAINER_NO_CXX17_CTAD) && (!defined(BOOST_CLANG) || (BOOST_CLANG_VERSION >= 80000))
|
||||
{
|
||||
typedef std::vector<int> MyStd;
|
||||
//Check Constructor Template Auto Deduction
|
||||
{
|
||||
MyStd gold = MyStd{ 1, 2, 3 };
|
||||
deque<int> test = deque(gold.begin(), gold.end());
|
||||
if (!test::CheckEqualContainers(gold, test)) return false;
|
||||
}
|
||||
{
|
||||
MyStd gold = MyStd{ 1, 2, 3 };
|
||||
deque<int> test = deque<int>(gold.begin(), gold.end(), new_allocator<int>());
|
||||
if (!test::CheckEqualContainers(gold, test)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
{ return true; }
|
||||
#endif
|
||||
|
||||
template<class VoidAllocator, bool Reservable>
|
||||
struct GetAllocatorCont
|
||||
{
|
||||
@@ -434,6 +441,9 @@ int main ()
|
||||
if(!do_test<test::copyable_int, true>())
|
||||
return 1;
|
||||
|
||||
if (!test_ctad())
|
||||
return 1;
|
||||
|
||||
//Default block size
|
||||
if(!do_test_default_block_size())
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user