diff options
author | medithe <40990424+medithe@users.noreply.github.com> | 2018-07-09 11:36:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-09 11:36:46 (GMT) |
commit | b50b2f775ed0268af9c83a96b285e296778d0743 (patch) | |
tree | 3b356112002c7f9aaae1a13be4432e38eaa9dcfc /googletest | |
parent | ba96d0b1161f540656efdaed035b3c062b60e006 (diff) | |
download | googletest-b50b2f775ed0268af9c83a96b285e296778d0743.zip googletest-b50b2f775ed0268af9c83a96b285e296778d0743.tar.gz googletest-b50b2f775ed0268af9c83a96b285e296778d0743.tar.bz2 |
Cast the tr1::tuple_element template parameter to int
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<I, Tuple> {};
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<I, Tuple>::type>::type get(
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/include/gtest/gtest-printers.h | 4 |
1 files 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<Tuple>::value; template <size_t I> - struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {}; + struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {}; template <size_t I> static typename AddReference< - const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get( + const typename ::std::tr1::tuple_element<static_cast<int>(I), Tuple>::type>::type get( const Tuple& tuple) { return ::std::tr1::get<I>(tuple); } |