[libcxx] r228344 - Get tests running with warnings. Fix warnings in headers and tests
Eric Fiselier
eric at efcs.ca
Thu Feb 5 12:28:37 PST 2015
Author: ericwf
Date: Thu Feb 5 14:28:37 2015
New Revision: 228344
URL: http://llvm.org/viewvc/llvm-project?rev=228344&view=rev
Log:
Get tests running with warnings. Fix warnings in headers and tests
Modified:
libcxx/trunk/include/__bit_reference
libcxx/trunk/include/algorithm
libcxx/trunk/test/libcxx/test/config.py
libcxx/trunk/test/std/utilities/date.time/tested_elsewhere.pass.cpp
libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
libcxx/trunk/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
libcxx/trunk/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
libcxx/trunk/test/std/utilities/memory/ptr.align/align.pass.cpp
libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp
libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
libcxx/trunk/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp
libcxx/trunk/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp
libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp
libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp
libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp
libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp
libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
libcxx/trunk/test/std/utilities/type.index/type.index.members/ctor.pass.cpp
Modified: libcxx/trunk/include/__bit_reference
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__bit_reference?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/include/__bit_reference (original)
+++ libcxx/trunk/include/__bit_reference Thu Feb 5 14:28:37 2015
@@ -906,7 +906,6 @@ rotate(__bit_iterator<_Cp, false> __firs
{
typedef __bit_iterator<_Cp, false> _I1;
typedef typename _I1::difference_type difference_type;
- typedef typename _I1::__storage_type __storage_type;
difference_type __d1 = __middle - __first;
difference_type __d2 = __last - __middle;
_I1 __r = __first + __d2;
Modified: libcxx/trunk/include/algorithm
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/include/algorithm (original)
+++ libcxx/trunk/include/algorithm Thu Feb 5 14:28:37 2015
@@ -4368,8 +4368,6 @@ __buffered_inplace_merge(_BidirectionalI
typename iterator_traits<_BidirectionalIterator>::value_type* __buff)
{
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);
unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
if (__len1 <= __len2)
@@ -4403,7 +4401,6 @@ __inplace_merge(_BidirectionalIterator _
typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
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;
while (true)
{
@@ -4790,7 +4787,6 @@ void
__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
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;
if (__len > 1)
{
Modified: libcxx/trunk/test/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/test/config.py (original)
+++ libcxx/trunk/test/libcxx/test/config.py Thu Feb 5 14:28:37 2015
@@ -92,6 +92,7 @@ class Configuration(object):
self.configure_env()
self.configure_compile_flags()
self.configure_link_flags()
+ self.configure_warnings()
self.configure_sanitizer()
self.configure_substitutions()
self.configure_features()
@@ -456,6 +457,14 @@ class Configuration(object):
else:
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):
san = self.get_lit_conf('use_sanitizer', '').strip()
if san:
Modified: libcxx/trunk/test/std/utilities/date.time/tested_elsewhere.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/date.time/tested_elsewhere.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/date.time/tested_elsewhere.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/date.time/tested_elsewhere.pass.cpp Thu Feb 5 14:28:37 2015
@@ -21,6 +21,7 @@
int main()
{
std::clock_t c = 0;
+ ((void)c); // avoid unused warning
std::size_t s = 0;
std::time_t t = 0;
std::tm tm = {0};
Modified: libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp Thu Feb 5 14:28:37 2015
@@ -276,6 +276,7 @@ test3()
const auto f = bind(&TFENode::foo, _1, 0UL);
const TFENode n = TFENode{};
bool b = f(n);
+ assert(b);
}
int main()
Modified: libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp Thu Feb 5 14:28:37 2015
@@ -12,13 +12,20 @@
// placeholders
#include <functional>
+#include <type_traits>
template <class T>
void
test(const T& t)
{
+ // Test default constructible.
T t2;
+ ((void)t2);
+ // Test copy constructible.
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()
Modified: libcxx/trunk/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp Thu Feb 5 14:28:37 2015
@@ -17,6 +17,7 @@
int main()
{
+ {
typedef std::bit_xor<int> F;
const F f = F();
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, 0) == 0x58D3);
assert(f(0xFFFF, 0x58D3) == 0xA72C);
+ }
#if _LIBCPP_STD_VER > 11
+ {
typedef std::bit_xor<> F2;
- const F2 f2 = F2();
+ const F2 f = F2();
assert(f(0xEA95, 0xEA95) == 0);
assert(f(0xEA95L, 0xEA95) == 0);
assert(f(0xEA95, 0xEA95L) == 0);
@@ -55,5 +58,6 @@ int main()
constexpr int bar = std::bit_xor<> () (0x58D3L, 0xEA95);
static_assert ( bar == 0xB246, "" );
+ }
#endif
}
Modified: libcxx/trunk/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp Thu Feb 5 14:28:37 2015
@@ -46,4 +46,5 @@ int main()
std::allocator<char> a2 = a;
a2 = a;
std::allocator<int> a3 = a2;
+ ((void)a3);
}
Modified: libcxx/trunk/test/std/utilities/memory/ptr.align/align.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/ptr.align/align.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/ptr.align/align.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/ptr.align/align.pass.cpp Thu Feb 5 14:28:37 2015
@@ -16,7 +16,6 @@
int main()
{
- int i = 0;
const unsigned N = 20;
char buf[N];
void* r;
Modified: libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp Thu Feb 5 14:28:37 2015
@@ -32,6 +32,7 @@ int main()
std::unique_ptr<A[]> p(new A[3]);
assert(A::count == 3);
A* i = p.get();
+ assert(i != nullptr);
p.reset();
assert(A::count == 0);
assert(p.get() == 0);
@@ -41,6 +42,7 @@ int main()
std::unique_ptr<A[]> p(new A[4]);
assert(A::count == 4);
A* i = p.get();
+ assert(i != nullptr);
p.reset(new A[5]);
assert(A::count == 5);
}
Modified: libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp Thu Feb 5 14:28:37 2015
@@ -32,6 +32,7 @@ int main()
std::unique_ptr<A> p(new A);
assert(A::count == 1);
A* i = p.get();
+ assert(i != nullptr);
p.reset();
assert(A::count == 0);
assert(p.get() == 0);
@@ -41,6 +42,7 @@ int main()
std::unique_ptr<A> p(new A);
assert(A::count == 1);
A* i = p.get();
+ assert(i != nullptr);
p.reset(new A);
assert(A::count == 1);
}
Modified: libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp Thu Feb 5 14:28:37 2015
@@ -44,6 +44,7 @@ int main()
assert(A::count == 1);
assert(B::count == 0);
A* i = p.get();
+ assert(i != nullptr);
p.reset(new B);
assert(A::count == 1);
assert(B::count == 1);
@@ -55,6 +56,7 @@ int main()
assert(A::count == 1);
assert(B::count == 1);
A* i = p.get();
+ assert(i != nullptr);
p.reset(new B);
assert(A::count == 1);
assert(B::count == 1);
Modified: libcxx/trunk/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp Thu Feb 5 14:28:37 2015
@@ -41,7 +41,9 @@ int main()
std::false_type f1;
std::false_type f2 = f1;
+ assert(!f2);
std::true_type t1;
std::true_type t2 = t1;
+ assert(t2);
}
Modified: libcxx/trunk/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp Thu Feb 5 14:28:37 2015
@@ -67,13 +67,13 @@ int main()
#endif
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
using type1 = std::result_of<decltype(&wat::foo)(wat)>::type;
+ static_assert(std::is_same<type1, void>::value, "");
#endif
#if _LIBCPP_STD_VER > 11
using type2 = std::result_of_t<decltype(&wat::foo)(wat)>;
+ static_assert(std::is_same<type2, void>::value, "");
#endif
-
-
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<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&&)) () const&&>::type, int>::value), "Error!");
#endif
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- using type = std::result_of<decltype(&wat::foo)(wat)>::type;
-#endif
}
Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp Thu Feb 5 14:28:37 2015
@@ -45,8 +45,6 @@ void test_class()
class Class
{
- int _;
- double __;
};
int main()
Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp Thu Feb 5 14:28:37 2015
@@ -36,8 +36,6 @@ void test_class()
class Class
{
- int _;
- double __;
};
int main()
Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp Thu Feb 5 14:28:37 2015
@@ -14,9 +14,13 @@
// static time_point now();
#include <chrono>
+#include <cassert>
int main()
{
typedef std::chrono::high_resolution_clock C;
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);
}
Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp Thu Feb 5 14:28:37 2015
@@ -20,4 +20,5 @@ int main()
{
typedef std::chrono::system_clock C;
C::time_point t1 = C::from_time_t(C::to_time_t(C::now()));
+ ((void)t1);
}
Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp Thu Feb 5 14:28:37 2015
@@ -14,9 +14,13 @@
// static time_point now();
#include <chrono>
+#include <cassert>
int main()
{
typedef std::chrono::system_clock C;
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);
}
Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp Thu Feb 5 14:28:37 2015
@@ -20,4 +20,5 @@ int main()
{
typedef std::chrono::system_clock C;
std::time_t t1 = C::to_time_t(C::now());
+ ((void)t1);
}
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp Thu Feb 5 14:28:37 2015
@@ -47,12 +47,12 @@ void test_default_constructible_extensio
typedef std::tuple<MoveOnly, MoveOnly, NoDefault> Tuple;
static_assert(!std::is_constructible<
- std::tuple<MoveOnly, MoveOnly, NoDefault>,
+ Tuple,
std::allocator_arg_t, A1<int>, MoveOnly, MoveOnly
>::value, "");
static_assert(std::is_constructible<
- std::tuple<MoveOnly, MoveOnly, NoDefault>,
+ Tuple,
std::allocator_arg_t, A1<int>, MoveOnly, MoveOnly, NoDefault
>::value, "");
}
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp Thu Feb 5 14:28:37 2015
@@ -25,6 +25,7 @@ int main()
typedef std::tuple<> T;
T t0;
T t = t0;
+ ((void)t); // Prevent unused warning
}
{
typedef std::tuple<int> T;
@@ -47,7 +48,7 @@ int main()
assert(std::get<1>(t) == 'a');
assert(std::get<2>(t) == "some text");
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER > 11
{
typedef std::tuple<int> T;
constexpr T t0(2);
@@ -58,6 +59,8 @@ int main()
typedef std::tuple<Empty> T;
constexpr T t0;
constexpr T t = t0;
+ constexpr Empty e = std::get<0>(t);
+ ((void)e); // Prevent unused warning
}
#endif
}
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp Thu Feb 5 14:28:37 2015
@@ -37,6 +37,7 @@ int main()
typedef std::tuple<> T;
T t0;
T t = std::move(t0);
+ ((void)t); // Prevent unused warning
}
{
typedef std::tuple<MoveOnly> T;
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp Thu Feb 5 14:28:37 2015
@@ -25,16 +25,20 @@ int main()
{
{
std::tuple<> t = std::tuple_cat();
+ ((void)t); // Prevent unused warning
}
{
std::tuple<> t1;
std::tuple<> t2 = std::tuple_cat(t1);
+ ((void)t2); // Prevent unused warning
}
{
std::tuple<> t = std::tuple_cat(std::tuple<>());
+ ((void)t); // Prevent unused warning
}
{
std::tuple<> t = std::tuple_cat(std::array<int, 0>());
+ ((void)t); // Prevent unused warning
}
{
std::tuple<int> t1(1);
@@ -42,19 +46,23 @@ int main()
assert(std::get<0>(t) == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER > 11
{
constexpr std::tuple<> t = std::tuple_cat();
+ ((void)t); // Prevent unused warning
}
{
constexpr std::tuple<> t1;
constexpr std::tuple<> t2 = std::tuple_cat(t1);
+ ((void)t2); // Prevent unused warning
}
{
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>());
+ ((void)t); // Prevent unused warning
}
{
constexpr std::tuple<int> t1(1);
@@ -90,6 +98,7 @@ int main()
std::tuple<> t1;
std::tuple<> t2;
std::tuple<> t3 = std::tuple_cat(t1, t2);
+ ((void)t3); // Prevent unused warning
}
{
std::tuple<> t1;
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp Thu Feb 5 14:28:37 2015
@@ -45,6 +45,7 @@ int main()
typedef std::tuple<Empty> T;
constexpr T t{Empty()};
constexpr Empty e = std::get<0>(t);
+ ((void)e); // Prevent unused warning
}
#endif
{
Modified: libcxx/trunk/test/std/utilities/type.index/type.index.members/ctor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/type.index/type.index.members/ctor.pass.cpp?rev=228344&r1=228343&r2=228344&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/type.index/type.index.members/ctor.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/type.index/type.index.members/ctor.pass.cpp Thu Feb 5 14:28:37 2015
@@ -13,10 +13,13 @@
// type_index(const type_info& rhs);
+#include <typeinfo>
#include <typeindex>
#include <cassert>
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());
}
More information about the cfe-commits
mailing list