Googletest: build problems with google mock

Created on 17 Jan 2020  路  4Comments  路  Source: google/googletest

I'm having build problems with google mock using this week's commit: daff5fea.

If I grab google test master: 8b4817

Then things go bad here - this seems to be true of various versions of clang and gcc (6,7,8,9):

Scanning dependencies of target gmock                                                                                                                                          
[ 28%] Building CXX object third_party/googletest/build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o                                                                     
In file included from /home/mrn/packages/benchmark/googletest/googlemock/include/gmock/gmock.h:66:0,                                                                           
                 from /home/mrn/packages/benchmark/googletest/googlemock/src/gmock-all.cc:39:                                                                                  
/home/mrn/packages/benchmark/googletest/googlemock/include/gmock/gmock-more-actions.h:138:1: error: ISO C++11 requires at least one argument for the "..." in a variadic macro 
 ACTION_P(ReturnPointee, pointer) { return *pointer; }                                                                                                                         
 ^~~~~~~~~~~~~~~~~~~~                                                                                                                                                          
/home/mrn/packages/benchmark/googletest/googlemock/include/gmock/gmock-more-actions.h:138:1: error: ISO C++11 requires at least one argument for the "..." in a variadic macro 
/home/mrn/packages/benchmark/googletest/googlemock/include/gmock/gmock-more-actions.h:138:1: error: ISO C++11 requires at least one argument for the "..." in a variadic macro 
/home/mrn/packages/benchmark/googletest/googlemock/include/gmock/gmock-more-actions.h:138:1: error: ISO C++11 requires at least one argument for the "..." in a variadic macro 
/home/mrn/packages/benchmark/googletest/googlemock/include/gmock/gmock-more-actions.h:138:1: error: ISO C++11 requires at least one argument for the "..." in a variadic macro 
 ACTION_P(ReturnPointee, pointer) { return *pointer; }                                                                                                                         

If I checkout release-1.8.1 of google test, builds on all the same compilers seem to go just fine.

Maybe this is entirely a problem with google test? If so, happy to close this issue.

Most helpful comment

Temporay solution:

Remove these line from benchmark/CMakeLists.txt:
add_cxx_compiler_flag(-pedantic) add_cxx_compiler_flag(-pedantic-errors)

All 4 comments

Same here. Returning to the version 1.10 fixes the build problem.

Temporay solution:

Remove these line from benchmark/CMakeLists.txt:
add_cxx_compiler_flag(-pedantic) add_cxx_compiler_flag(-pedantic-errors)

Has this been fixed at head? If not, can you provide reproduction instructions?

Has this been fixed at head? If not, can you provide reproduction instructions?

Yes, fixed.

Was this page helpful?
0 / 5 - 0 ratings