Get tests running with warnings. Fix warnings in headers and tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
70e0af45ae
commit
75fdf0ea7c
@ -906,7 +906,6 @@ rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle,
|
|||||||
{
|
{
|
||||||
typedef __bit_iterator<_Cp, false> _I1;
|
typedef __bit_iterator<_Cp, false> _I1;
|
||||||
typedef typename _I1::difference_type difference_type;
|
typedef typename _I1::difference_type difference_type;
|
||||||
typedef typename _I1::__storage_type __storage_type;
|
|
||||||
difference_type __d1 = __middle - __first;
|
difference_type __d1 = __middle - __first;
|
||||||
difference_type __d2 = __last - __middle;
|
difference_type __d2 = __last - __middle;
|
||||||
_I1 __r = __first + __d2;
|
_I1 __r = __first + __d2;
|
||||||
|
@ -4368,8 +4368,6 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator
|
|||||||
typename iterator_traits<_BidirectionalIterator>::value_type* __buff)
|
typename iterator_traits<_BidirectionalIterator>::value_type* __buff)
|
||||||
{
|
{
|
||||||
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
|
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
|
||||||
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
|
|
||||||
typedef typename iterator_traits<_BidirectionalIterator>::pointer pointer;
|
|
||||||
__destruct_n __d(0);
|
__destruct_n __d(0);
|
||||||
unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
|
unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
|
||||||
if (__len1 <= __len2)
|
if (__len1 <= __len2)
|
||||||
@ -4403,7 +4401,6 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
|
|||||||
typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
|
typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
|
||||||
typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size)
|
typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size)
|
||||||
{
|
{
|
||||||
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
|
|
||||||
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
|
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@ -4790,7 +4787,6 @@ void
|
|||||||
__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
|
__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
|
||||||
typename iterator_traits<_RandomAccessIterator>::difference_type __len)
|
typename iterator_traits<_RandomAccessIterator>::difference_type __len)
|
||||||
{
|
{
|
||||||
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
|
|
||||||
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
|
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
|
||||||
if (__len > 1)
|
if (__len > 1)
|
||||||
{
|
{
|
||||||
|
@ -92,6 +92,7 @@ class Configuration(object):
|
|||||||
self.configure_env()
|
self.configure_env()
|
||||||
self.configure_compile_flags()
|
self.configure_compile_flags()
|
||||||
self.configure_link_flags()
|
self.configure_link_flags()
|
||||||
|
self.configure_warnings()
|
||||||
self.configure_sanitizer()
|
self.configure_sanitizer()
|
||||||
self.configure_substitutions()
|
self.configure_substitutions()
|
||||||
self.configure_features()
|
self.configure_features()
|
||||||
@ -456,6 +457,14 @@ class Configuration(object):
|
|||||||
else:
|
else:
|
||||||
self.lit_config.fatal("unrecognized system: %r" % sys.platform)
|
self.lit_config.fatal("unrecognized system: %r" % sys.platform)
|
||||||
|
|
||||||
|
def configure_warnings(self):
|
||||||
|
enable_warnings = self.get_lit_bool('enable_warnings', False)
|
||||||
|
if enable_warnings:
|
||||||
|
self.cxx.compile_flags += ['-Wsystem-headers', '-Wall', '-Werror']
|
||||||
|
if ('clang' in self.config.available_features or
|
||||||
|
'apple-clang' in self.config.available_features):
|
||||||
|
self.cxx.compile_flags += ['-Wno-user-defined-literals']
|
||||||
|
|
||||||
def configure_sanitizer(self):
|
def configure_sanitizer(self):
|
||||||
san = self.get_lit_conf('use_sanitizer', '').strip()
|
san = self.get_lit_conf('use_sanitizer', '').strip()
|
||||||
if san:
|
if san:
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::clock_t c = 0;
|
std::clock_t c = 0;
|
||||||
|
((void)c); // avoid unused warning
|
||||||
std::size_t s = 0;
|
std::size_t s = 0;
|
||||||
std::time_t t = 0;
|
std::time_t t = 0;
|
||||||
std::tm tm = {0};
|
std::tm tm = {0};
|
||||||
|
@ -276,6 +276,7 @@ test3()
|
|||||||
const auto f = bind(&TFENode::foo, _1, 0UL);
|
const auto f = bind(&TFENode::foo, _1, 0UL);
|
||||||
const TFENode n = TFENode{};
|
const TFENode n = TFENode{};
|
||||||
bool b = f(n);
|
bool b = f(n);
|
||||||
|
assert(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -12,13 +12,20 @@
|
|||||||
// placeholders
|
// placeholders
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void
|
void
|
||||||
test(const T& t)
|
test(const T& t)
|
||||||
{
|
{
|
||||||
|
// Test default constructible.
|
||||||
T t2;
|
T t2;
|
||||||
|
((void)t2);
|
||||||
|
// Test copy constructible.
|
||||||
T t3 = t;
|
T t3 = t;
|
||||||
|
((void)t3);
|
||||||
|
static_assert(std::is_nothrow_copy_constructible<T>::value, "");
|
||||||
|
static_assert(std::is_nothrow_move_constructible<T>::value, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
{
|
||||||
typedef std::bit_xor<int> F;
|
typedef std::bit_xor<int> F;
|
||||||
const F f = F();
|
const F f = F();
|
||||||
static_assert((std::is_same<int, F::first_argument_type>::value), "" );
|
static_assert((std::is_same<int, F::first_argument_type>::value), "" );
|
||||||
@ -27,9 +28,11 @@ int main()
|
|||||||
assert(f(0x58D3, 0xEA95) == 0xB246);
|
assert(f(0x58D3, 0xEA95) == 0xB246);
|
||||||
assert(f(0x58D3, 0) == 0x58D3);
|
assert(f(0x58D3, 0) == 0x58D3);
|
||||||
assert(f(0xFFFF, 0x58D3) == 0xA72C);
|
assert(f(0xFFFF, 0x58D3) == 0xA72C);
|
||||||
|
}
|
||||||
#if _LIBCPP_STD_VER > 11
|
#if _LIBCPP_STD_VER > 11
|
||||||
|
{
|
||||||
typedef std::bit_xor<> F2;
|
typedef std::bit_xor<> F2;
|
||||||
const F2 f2 = F2();
|
const F2 f = F2();
|
||||||
assert(f(0xEA95, 0xEA95) == 0);
|
assert(f(0xEA95, 0xEA95) == 0);
|
||||||
assert(f(0xEA95L, 0xEA95) == 0);
|
assert(f(0xEA95L, 0xEA95) == 0);
|
||||||
assert(f(0xEA95, 0xEA95L) == 0);
|
assert(f(0xEA95, 0xEA95L) == 0);
|
||||||
@ -55,5 +58,6 @@ int main()
|
|||||||
|
|
||||||
constexpr int bar = std::bit_xor<> () (0x58D3L, 0xEA95);
|
constexpr int bar = std::bit_xor<> () (0x58D3L, 0xEA95);
|
||||||
static_assert ( bar == 0xB246, "" );
|
static_assert ( bar == 0xB246, "" );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -46,4 +46,5 @@ int main()
|
|||||||
std::allocator<char> a2 = a;
|
std::allocator<char> a2 = a;
|
||||||
a2 = a;
|
a2 = a;
|
||||||
std::allocator<int> a3 = a2;
|
std::allocator<int> a3 = a2;
|
||||||
|
((void)a3);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
const unsigned N = 20;
|
const unsigned N = 20;
|
||||||
char buf[N];
|
char buf[N];
|
||||||
void* r;
|
void* r;
|
||||||
|
@ -32,6 +32,7 @@ int main()
|
|||||||
std::unique_ptr<A[]> p(new A[3]);
|
std::unique_ptr<A[]> p(new A[3]);
|
||||||
assert(A::count == 3);
|
assert(A::count == 3);
|
||||||
A* i = p.get();
|
A* i = p.get();
|
||||||
|
assert(i != nullptr);
|
||||||
p.reset();
|
p.reset();
|
||||||
assert(A::count == 0);
|
assert(A::count == 0);
|
||||||
assert(p.get() == 0);
|
assert(p.get() == 0);
|
||||||
@ -41,6 +42,7 @@ int main()
|
|||||||
std::unique_ptr<A[]> p(new A[4]);
|
std::unique_ptr<A[]> p(new A[4]);
|
||||||
assert(A::count == 4);
|
assert(A::count == 4);
|
||||||
A* i = p.get();
|
A* i = p.get();
|
||||||
|
assert(i != nullptr);
|
||||||
p.reset(new A[5]);
|
p.reset(new A[5]);
|
||||||
assert(A::count == 5);
|
assert(A::count == 5);
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ int main()
|
|||||||
std::unique_ptr<A> p(new A);
|
std::unique_ptr<A> p(new A);
|
||||||
assert(A::count == 1);
|
assert(A::count == 1);
|
||||||
A* i = p.get();
|
A* i = p.get();
|
||||||
|
assert(i != nullptr);
|
||||||
p.reset();
|
p.reset();
|
||||||
assert(A::count == 0);
|
assert(A::count == 0);
|
||||||
assert(p.get() == 0);
|
assert(p.get() == 0);
|
||||||
@ -41,6 +42,7 @@ int main()
|
|||||||
std::unique_ptr<A> p(new A);
|
std::unique_ptr<A> p(new A);
|
||||||
assert(A::count == 1);
|
assert(A::count == 1);
|
||||||
A* i = p.get();
|
A* i = p.get();
|
||||||
|
assert(i != nullptr);
|
||||||
p.reset(new A);
|
p.reset(new A);
|
||||||
assert(A::count == 1);
|
assert(A::count == 1);
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ int main()
|
|||||||
assert(A::count == 1);
|
assert(A::count == 1);
|
||||||
assert(B::count == 0);
|
assert(B::count == 0);
|
||||||
A* i = p.get();
|
A* i = p.get();
|
||||||
|
assert(i != nullptr);
|
||||||
p.reset(new B);
|
p.reset(new B);
|
||||||
assert(A::count == 1);
|
assert(A::count == 1);
|
||||||
assert(B::count == 1);
|
assert(B::count == 1);
|
||||||
@ -55,6 +56,7 @@ int main()
|
|||||||
assert(A::count == 1);
|
assert(A::count == 1);
|
||||||
assert(B::count == 1);
|
assert(B::count == 1);
|
||||||
A* i = p.get();
|
A* i = p.get();
|
||||||
|
assert(i != nullptr);
|
||||||
p.reset(new B);
|
p.reset(new B);
|
||||||
assert(A::count == 1);
|
assert(A::count == 1);
|
||||||
assert(B::count == 1);
|
assert(B::count == 1);
|
||||||
|
@ -41,7 +41,9 @@ int main()
|
|||||||
|
|
||||||
std::false_type f1;
|
std::false_type f1;
|
||||||
std::false_type f2 = f1;
|
std::false_type f2 = f1;
|
||||||
|
assert(!f2);
|
||||||
|
|
||||||
std::true_type t1;
|
std::true_type t1;
|
||||||
std::true_type t2 = t1;
|
std::true_type t2 = t1;
|
||||||
|
assert(t2);
|
||||||
}
|
}
|
||||||
|
@ -67,13 +67,13 @@ int main()
|
|||||||
#endif
|
#endif
|
||||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
using type1 = std::result_of<decltype(&wat::foo)(wat)>::type;
|
using type1 = std::result_of<decltype(&wat::foo)(wat)>::type;
|
||||||
|
static_assert(std::is_same<type1, void>::value, "");
|
||||||
#endif
|
#endif
|
||||||
#if _LIBCPP_STD_VER > 11
|
#if _LIBCPP_STD_VER > 11
|
||||||
using type2 = std::result_of_t<decltype(&wat::foo)(wat)>;
|
using type2 = std::result_of_t<decltype(&wat::foo)(wat)>;
|
||||||
|
static_assert(std::is_same<type2, void>::value, "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static_assert((std::is_same<std::result_of<S(int)>::type, short>::value), "Error!");
|
static_assert((std::is_same<std::result_of<S(int)>::type, short>::value), "Error!");
|
||||||
static_assert((std::is_same<std::result_of<S&(unsigned char, int&)>::type, double>::value), "Error!");
|
static_assert((std::is_same<std::result_of<S&(unsigned char, int&)>::type, double>::value), "Error!");
|
||||||
static_assert((std::is_same<std::result_of<PF1()>::type, bool>::value), "Error!");
|
static_assert((std::is_same<std::result_of<PF1()>::type, bool>::value), "Error!");
|
||||||
@ -92,7 +92,4 @@ int main()
|
|||||||
static_assert((std::is_same<std::result_of<int (F::* (F &&)) () const&&>::type, int>::value), "Error!");
|
static_assert((std::is_same<std::result_of<int (F::* (F &&)) () const&&>::type, int>::value), "Error!");
|
||||||
static_assert((std::is_same<std::result_of<int (F::* (F const&&)) () const&&>::type, int>::value), "Error!");
|
static_assert((std::is_same<std::result_of<int (F::* (F const&&)) () const&&>::type, int>::value), "Error!");
|
||||||
#endif
|
#endif
|
||||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
|
||||||
using type = std::result_of<decltype(&wat::foo)(wat)>::type;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,6 @@ void test_class()
|
|||||||
|
|
||||||
class Class
|
class Class
|
||||||
{
|
{
|
||||||
int _;
|
|
||||||
double __;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -36,8 +36,6 @@ void test_class()
|
|||||||
|
|
||||||
class Class
|
class Class
|
||||||
{
|
{
|
||||||
int _;
|
|
||||||
double __;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -14,9 +14,13 @@
|
|||||||
// static time_point now();
|
// static time_point now();
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
typedef std::chrono::high_resolution_clock C;
|
typedef std::chrono::high_resolution_clock C;
|
||||||
C::time_point t1 = C::now();
|
C::time_point t1 = C::now();
|
||||||
|
assert(t1.time_since_epoch().count() != 0);
|
||||||
|
assert(C::time_point::min() < t1);
|
||||||
|
assert(C::time_point::max() > t1);
|
||||||
}
|
}
|
||||||
|
@ -20,4 +20,5 @@ int main()
|
|||||||
{
|
{
|
||||||
typedef std::chrono::system_clock C;
|
typedef std::chrono::system_clock C;
|
||||||
C::time_point t1 = C::from_time_t(C::to_time_t(C::now()));
|
C::time_point t1 = C::from_time_t(C::to_time_t(C::now()));
|
||||||
|
((void)t1);
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,13 @@
|
|||||||
// static time_point now();
|
// static time_point now();
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
typedef std::chrono::system_clock C;
|
typedef std::chrono::system_clock C;
|
||||||
C::time_point t1 = C::now();
|
C::time_point t1 = C::now();
|
||||||
|
assert(t1.time_since_epoch().count() != 0);
|
||||||
|
assert(C::time_point::min() < t1);
|
||||||
|
assert(C::time_point::max() > t1);
|
||||||
}
|
}
|
||||||
|
@ -20,4 +20,5 @@ int main()
|
|||||||
{
|
{
|
||||||
typedef std::chrono::system_clock C;
|
typedef std::chrono::system_clock C;
|
||||||
std::time_t t1 = C::to_time_t(C::now());
|
std::time_t t1 = C::to_time_t(C::now());
|
||||||
|
((void)t1);
|
||||||
}
|
}
|
||||||
|
@ -47,12 +47,12 @@ void test_default_constructible_extension_sfinae()
|
|||||||
typedef std::tuple<MoveOnly, MoveOnly, NoDefault> Tuple;
|
typedef std::tuple<MoveOnly, MoveOnly, NoDefault> Tuple;
|
||||||
|
|
||||||
static_assert(!std::is_constructible<
|
static_assert(!std::is_constructible<
|
||||||
std::tuple<MoveOnly, MoveOnly, NoDefault>,
|
Tuple,
|
||||||
std::allocator_arg_t, A1<int>, MoveOnly, MoveOnly
|
std::allocator_arg_t, A1<int>, MoveOnly, MoveOnly
|
||||||
>::value, "");
|
>::value, "");
|
||||||
|
|
||||||
static_assert(std::is_constructible<
|
static_assert(std::is_constructible<
|
||||||
std::tuple<MoveOnly, MoveOnly, NoDefault>,
|
Tuple,
|
||||||
std::allocator_arg_t, A1<int>, MoveOnly, MoveOnly, NoDefault
|
std::allocator_arg_t, A1<int>, MoveOnly, MoveOnly, NoDefault
|
||||||
>::value, "");
|
>::value, "");
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ int main()
|
|||||||
typedef std::tuple<> T;
|
typedef std::tuple<> T;
|
||||||
T t0;
|
T t0;
|
||||||
T t = t0;
|
T t = t0;
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
typedef std::tuple<int> T;
|
typedef std::tuple<int> T;
|
||||||
@ -47,7 +48,7 @@ int main()
|
|||||||
assert(std::get<1>(t) == 'a');
|
assert(std::get<1>(t) == 'a');
|
||||||
assert(std::get<2>(t) == "some text");
|
assert(std::get<2>(t) == "some text");
|
||||||
}
|
}
|
||||||
#if _LIBCPP_STD_VER > 11
|
#if _LIBCPP_STD_VER > 11
|
||||||
{
|
{
|
||||||
typedef std::tuple<int> T;
|
typedef std::tuple<int> T;
|
||||||
constexpr T t0(2);
|
constexpr T t0(2);
|
||||||
@ -58,6 +59,8 @@ int main()
|
|||||||
typedef std::tuple<Empty> T;
|
typedef std::tuple<Empty> T;
|
||||||
constexpr T t0;
|
constexpr T t0;
|
||||||
constexpr T t = t0;
|
constexpr T t = t0;
|
||||||
|
constexpr Empty e = std::get<0>(t);
|
||||||
|
((void)e); // Prevent unused warning
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ int main()
|
|||||||
typedef std::tuple<> T;
|
typedef std::tuple<> T;
|
||||||
T t0;
|
T t0;
|
||||||
T t = std::move(t0);
|
T t = std::move(t0);
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
typedef std::tuple<MoveOnly> T;
|
typedef std::tuple<MoveOnly> T;
|
||||||
|
@ -25,16 +25,20 @@ int main()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::tuple<> t = std::tuple_cat();
|
std::tuple<> t = std::tuple_cat();
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::tuple<> t1;
|
std::tuple<> t1;
|
||||||
std::tuple<> t2 = std::tuple_cat(t1);
|
std::tuple<> t2 = std::tuple_cat(t1);
|
||||||
|
((void)t2); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::tuple<> t = std::tuple_cat(std::tuple<>());
|
std::tuple<> t = std::tuple_cat(std::tuple<>());
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::tuple<> t = std::tuple_cat(std::array<int, 0>());
|
std::tuple<> t = std::tuple_cat(std::array<int, 0>());
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::tuple<int> t1(1);
|
std::tuple<int> t1(1);
|
||||||
@ -42,19 +46,23 @@ int main()
|
|||||||
assert(std::get<0>(t) == 1);
|
assert(std::get<0>(t) == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _LIBCPP_STD_VER > 11
|
#if _LIBCPP_STD_VER > 11
|
||||||
{
|
{
|
||||||
constexpr std::tuple<> t = std::tuple_cat();
|
constexpr std::tuple<> t = std::tuple_cat();
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
constexpr std::tuple<> t1;
|
constexpr std::tuple<> t1;
|
||||||
constexpr std::tuple<> t2 = std::tuple_cat(t1);
|
constexpr std::tuple<> t2 = std::tuple_cat(t1);
|
||||||
|
((void)t2); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
constexpr std::tuple<> t = std::tuple_cat(std::tuple<>());
|
constexpr std::tuple<> t = std::tuple_cat(std::tuple<>());
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
constexpr std::tuple<> t = std::tuple_cat(std::array<int, 0>());
|
constexpr std::tuple<> t = std::tuple_cat(std::array<int, 0>());
|
||||||
|
((void)t); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
constexpr std::tuple<int> t1(1);
|
constexpr std::tuple<int> t1(1);
|
||||||
@ -90,6 +98,7 @@ int main()
|
|||||||
std::tuple<> t1;
|
std::tuple<> t1;
|
||||||
std::tuple<> t2;
|
std::tuple<> t2;
|
||||||
std::tuple<> t3 = std::tuple_cat(t1, t2);
|
std::tuple<> t3 = std::tuple_cat(t1, t2);
|
||||||
|
((void)t3); // Prevent unused warning
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::tuple<> t1;
|
std::tuple<> t1;
|
||||||
|
@ -45,6 +45,7 @@ int main()
|
|||||||
typedef std::tuple<Empty> T;
|
typedef std::tuple<Empty> T;
|
||||||
constexpr T t{Empty()};
|
constexpr T t{Empty()};
|
||||||
constexpr Empty e = std::get<0>(t);
|
constexpr Empty e = std::get<0>(t);
|
||||||
|
((void)e); // Prevent unused warning
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -13,10 +13,13 @@
|
|||||||
|
|
||||||
// type_index(const type_info& rhs);
|
// type_index(const type_info& rhs);
|
||||||
|
|
||||||
|
#include <typeinfo>
|
||||||
#include <typeindex>
|
#include <typeindex>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::type_index t1 = typeid(int);
|
std::type_info const & info = typeid(int);
|
||||||
|
std::type_index t1(info);
|
||||||
|
assert(t1.name() == info.name());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user