Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@137522 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include <initializer_list>
|
||||
#include <cassert>
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
struct A
|
||||
{
|
||||
A(std::initializer_list<int> il)
|
||||
@@ -30,9 +32,11 @@ struct A
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
A test1 = {3, 2, 1};
|
||||
#endif
|
||||
}
|
||||
|
@@ -18,6 +18,8 @@ struct A {};
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
std::initializer_list<A> il;
|
||||
assert(il.size() == 0);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
@@ -14,6 +14,8 @@
|
||||
#include <initializer_list>
|
||||
#include <cassert>
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
struct A
|
||||
{
|
||||
A(std::initializer_list<int> il)
|
||||
@@ -28,9 +30,11 @@ struct A
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
A test1 = {3, 2, 1};
|
||||
#endif
|
||||
}
|
||||
|
@@ -26,10 +26,12 @@ struct A {};
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
static_assert((std::is_same<std::initializer_list<A>::value_type, A>::value), "");
|
||||
static_assert((std::is_same<std::initializer_list<A>::reference, const A&>::value), "");
|
||||
static_assert((std::is_same<std::initializer_list<A>::const_reference, const A&>::value), "");
|
||||
static_assert((std::is_same<std::initializer_list<A>::size_type, std::size_t>::value), "");
|
||||
static_assert((std::is_same<std::initializer_list<A>::iterator, const A*>::value), "");
|
||||
static_assert((std::is_same<std::initializer_list<A>::const_iterator, const A*>::value), "");
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
Reference in New Issue
Block a user