Googletest: failed build on centos6 master

Created on 22 Apr 2018  Â·  9Comments  Â·  Source: google/googletest

[ 50%] Building CXX object googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o cd /home/jenkins/workspace/Codec/build/googletest-prefix/src/googletest-build/googlemock && /usr/bin/c++ -I/home/jenkins/workspace/Codec/ext/googletest/googlemock/include -I/home/jenkins/workspace/Codec/ext/googletest/googlemock -isystem /home/jenkins/workspace/Codec/ext/googletest/googletest/include -I/home/jenkins/workspace/Codec/ext/googletest/googletest -Wall -Wshadow -Werror -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -o CMakeFiles/gmock.dir/src/gmock-all.cc.o -c /home/jenkins/workspace/Codec/ext/googletest/googlemock/src/gmock-all.cc cc1plus: warnings being treated as errors In file included from /home/jenkins/workspace/Codec/ext/googletest/googlemock/include/gmock/gmock-spec-builders.h:70, from /home/jenkins/workspace/Codec/ext/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h:43, from /home/jenkins/workspace/Codec/ext/googletest/googlemock/include/gmock/gmock.h:61, from /home/jenkins/workspace/Codec/ext/googletest/googlemock/src/gmock-all.cc:40: /home/jenkins/workspace/Codec/ext/googletest/googlemock/include/gmock/gmock-matchers.h: In member function ‘testing::internal::PointwiseMatcher<TupleMatcher, RhsContainer>::operator testing::Matcher<T>() const’: /home/jenkins/workspace/Codec/ext/googletest/googlemock/include/gmock/gmock-matchers.h:3049: error: declaration of ‘use_UnorderedPointwise_with_hash_tables’ shadows a member of 'this'

Most helpful comment

I had the same problem with gcc 4.4.7 on centos:6 on Docker.

# make
[ 25%] Built target gtest
[ 50%] Building CXX object googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
cc1plus: warnings being treated as errors
In file included from /tmp/googletest/googlemock/include/gmock/gmock-spec-builders.h:72,
                 from /tmp/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h:45,
                 from /tmp/googletest/googlemock/include/gmock/gmock.h:63,
                 from /tmp/googletest/googlemock/src/gmock-all.cc:40:
/tmp/googletest/googlemock/include/gmock/gmock-matchers.h: In member function ‘testing::internal::PointwiseMatcher<TupleMatcher, RhsContainer>::operator testing::Matcher<T>() const’:
/tmp/googletest/googlemock/include/gmock/gmock-matchers.h:3012: error: declaration of ‘use_UnorderedPointwise_with_hash_tables’ shadows a member of 'this'
make[2]: *** [googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1
make[1]: *** [googlemock/CMakeFiles/gmock.dir/all] Error 2
make: *** [all] Error 2

All 9 comments

maybe GNU version is lower. GNU > 4.0

got the same problem

$ gcc --version
gcc (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I can confirm the same problem with 4.4.7 :(

I had the same problem with gcc 4.4.7 on centos:6 on Docker.

# make
[ 25%] Built target gtest
[ 50%] Building CXX object googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
cc1plus: warnings being treated as errors
In file included from /tmp/googletest/googlemock/include/gmock/gmock-spec-builders.h:72,
                 from /tmp/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h:45,
                 from /tmp/googletest/googlemock/include/gmock/gmock.h:63,
                 from /tmp/googletest/googlemock/src/gmock-all.cc:40:
/tmp/googletest/googlemock/include/gmock/gmock-matchers.h: In member function ‘testing::internal::PointwiseMatcher<TupleMatcher, RhsContainer>::operator testing::Matcher<T>() const’:
/tmp/googletest/googlemock/include/gmock/gmock-matchers.h:3012: error: declaration of ‘use_UnorderedPointwise_with_hash_tables’ shadows a member of 'this'
make[2]: *** [googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1
make[1]: *** [googlemock/CMakeFiles/gmock.dir/all] Error 2
make: *** [all] Error 2

Thank you very much for this report. The best way to approach this would be to create a proper PR and submit it for consideration.

Had the same issue with release-1.8.1. release-1.8.0 worked.

Thank you very much for this report. Unfortunately there appears to be no actionable information.
The path to solution would start with creating a reproducible build on travis.

The issue still exists in 1.8.1 and NOT in master branch. It was introduced to 1.8.1 only by https://github.com/google/googletest/pull/1512.
This code
GTEST_COMPILE_ASSERT_(
!IsHashTable use_UnorderedPointwise_with_hash_tables);

Creates 2nd variable use_UnorderedPointwise_with_hash_tables.

I've corrected it with https://github.com/google/googletest/pull/2053.

Fixed with #2073.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GoogleCodeExporter picture GoogleCodeExporter  Â·  5Comments

marknelson picture marknelson  Â·  4Comments

ebioman picture ebioman  Â·  3Comments

maygamboa picture maygamboa  Â·  6Comments

AstralStorm picture AstralStorm  Â·  4Comments