summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/libcxx/test/config.py9
-rw-r--r--libcxx/test/std/utilities/date.time/tested_elsewhere.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp7
-rw-r--r--libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp6
-rw-r--r--libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/memory/ptr.align/align.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp2
-rw-r--r--libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp2
-rw-r--r--libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp2
-rw-r--r--libcxx/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp2
-rw-r--r--libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp7
-rw-r--r--libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp2
-rw-r--r--libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp2
-rw-r--r--libcxx/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp4
-rw-r--r--libcxx/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp4
-rw-r--r--libcxx/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp4
-rw-r--r--libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp5
-rw-r--r--libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp11
-rw-r--r--libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/type.index/type.index.members/ctor.pass.cpp5
24 files changed, 66 insertions, 16 deletions
diff --git a/libcxx/test/libcxx/test/config.py b/libcxx/test/libcxx/test/config.py
index 9c418b6e47a..50854db9e05 100644
--- a/libcxx/test/libcxx/test/config.py
+++ b/libcxx/test/libcxx/test/config.py
@@ -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:
diff --git a/libcxx/test/std/utilities/date.time/tested_elsewhere.pass.cpp b/libcxx/test/std/utilities/date.time/tested_elsewhere.pass.cpp
index e1d1c73b3c1..419f415dee1 100644
--- a/libcxx/test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ b/libcxx/test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -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};
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
index 1125844a1f3..af5efe464d5 100644
--- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
@@ -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()
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
index fa791d46ff5..246186040c5 100644
--- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
@@ -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()
diff --git a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
index d8690aa8268..bbf2ce5baf1 100644
--- a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
@@ -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
}
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
index b0282d7b887..db08123a3e5 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
@@ -46,4 +46,5 @@ int main()
std::allocator<char> a2 = a;
a2 = a;
std::allocator<int> a3 = a2;
+ ((void)a3);
}
diff --git a/libcxx/test/std/utilities/memory/ptr.align/align.pass.cpp b/libcxx/test/std/utilities/memory/ptr.align/align.pass.cpp
index e4e2e0ae6a5..d77d13c906d 100644
--- a/libcxx/test/std/utilities/memory/ptr.align/align.pass.cpp
+++ b/libcxx/test/std/utilities/memory/ptr.align/align.pass.cpp
@@ -16,7 +16,6 @@
int main()
{
- int i = 0;
const unsigned N = 20;
char buf[N];
void* r;
diff --git a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp
index 8233ca0e143..195d877bbb7 100644
--- a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp
+++ b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp
@@ -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);
}
diff --git a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
index 4041fbb2675..2cf7f8b7756 100644
--- a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
+++ b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
@@ -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);
}
diff --git a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
index 6acc3d75063..2de7787b267 100644
--- a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
+++ b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
@@ -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);
diff --git a/libcxx/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp b/libcxx/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp
index 1ad1adcc5cd..335305a2823 100644
--- a/libcxx/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.hel/integral_constant.pass.cpp
@@ -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);
}
diff --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
index bf44c340ee5..1064d59e8b4 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
@@ -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
}
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp
index 0de00485572..ac5d6e59231 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp
@@ -45,8 +45,6 @@ void test_class()
class Class
{
- int _;
- double __;
};
int main()
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp
index a77a10149d3..49e41380ca2 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp
@@ -36,8 +36,6 @@ void test_class()
class Class
{
- int _;
- double __;
};
int main()
diff --git a/libcxx/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp b/libcxx/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp
index 0bcd99d76ad..ab67cd838f9 100644
--- a/libcxx/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp
+++ b/libcxx/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp
@@ -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);
}
diff --git a/libcxx/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp b/libcxx/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp
index 9b12a667ffd..f4a454f5780 100644
--- a/libcxx/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp
+++ b/libcxx/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp
@@ -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);
}
diff --git a/libcxx/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp b/libcxx/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp
index 60530fdf3a9..ebc0db80b64 100644
--- a/libcxx/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp
+++ b/libcxx/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp
@@ -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);
}
diff --git a/libcxx/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp b/libcxx/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp
index 2a82d5375e1..c4028063bc5 100644
--- a/libcxx/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp
+++ b/libcxx/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp
@@ -20,4 +20,5 @@ int main()
{
typedef std::chrono::system_clock C;
std::time_t t1 = C::to_time_t(C::now());
+ ((void)t1);
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp
index 864d5b5079b..4757422cebb 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp
@@ -47,12 +47,12 @@ void test_default_constructible_extension_sfinae()
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, "");
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
index fd953f84340..ec40a18fba6 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
@@ -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
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
index 60e6f7e6421..c4f2f110c77 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
@@ -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;
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
index d1e2ce3ca95..3c5a8426331 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
@@ -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;
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
index 0ba898d98d8..04bf5b2b9bf 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
@@ -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
{
diff --git a/libcxx/test/std/utilities/type.index/type.index.members/ctor.pass.cpp b/libcxx/test/std/utilities/type.index/type.index.members/ctor.pass.cpp
index 2904e4a2e7c..e5183eb87a7 100644
--- a/libcxx/test/std/utilities/type.index/type.index.members/ctor.pass.cpp
+++ b/libcxx/test/std/utilities/type.index/type.index.members/ctor.pass.cpp
@@ -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());
}
OpenPOWER on IntegriCloud