From b50b2f775ed0268af9c83a96b285e296778d0743 Mon Sep 17 00:00:00 2001 From: medithe <40990424+medithe@users.noreply.github.com> Date: Mon, 9 Jul 2018 13:36:46 +0200 Subject: Cast the tr1::tuple_element template parameter to int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because in `std::tr1::tuple_element` the first template parameter should be of type int (https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.4/a00547.html), but the code inserts a size_t, the first template parameter should be casted to int before, to get rid of the following errors: googletest-src/googletest/include/gtest/gtest-printers.h:957:60: error: conversion from ‘long unsigned int’ to ‘int’ may change value [-Werror=conversion] struct tuple_element : ::std::tr1::tuple_element {}; and googletest-src/googletest/include/gtest/gtest-printers.h:961:56: error: conversion from ‘long unsigned int’ to ‘int’ may change value [-Werror=conversion] const typename ::std::tr1::tuple_element::type>::type get( --- googletest/include/gtest/gtest-printers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 373946b..fa465c3 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -954,11 +954,11 @@ struct TuplePolicy { static const size_t tuple_size = ::std::tr1::tuple_size::value; template - struct tuple_element : ::std::tr1::tuple_element {}; + struct tuple_element : ::std::tr1::tuple_element(I), Tuple> {}; template static typename AddReference< - const typename ::std::tr1::tuple_element::type>::type get( + const typename ::std::tr1::tuple_element(I), Tuple>::type>::type get( const Tuple& tuple) { return ::std::tr1::get(tuple); } -- cgit v0.12