CGBN icon indicating copy to clipboard operation
CGBN copied to clipboard

GTest now requires C++14

Open ccorn opened this issue 2 years ago • 0 comments

Newer Google Test explicitly requires C++14. Indeed the source now uses std::less<> without template argument:

make -C unit_tests pascal
make[1]: Entering directory '/build/cgbn-git/src/CGBN/unit_tests'
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/cgbn-git/src=/usr/src/debug/cgbn-git -flto=auto -isystem /usr/src/googletest/include -I/usr/src/googletest -pthread -std=c++11 -c /usr/src/googletest/src/gtest-all.cc
In file included from /usr/include/gtest/gtest-message.h:57,
                 from /usr/include/gtest/gtest-assertion-result.h:46,
                 from /usr/include/gtest/gtest.h:64,
                 from /usr/src/googletest/src/gtest-all.cc:38:
/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++ versions less than C++14 are not supported.
  270 | #error C++ versions less than C++14 are not supported.
      |  ^~~~~
In file included from /usr/include/gtest/gtest-printers.h:115,
                 from /usr/include/gtest/gtest-matchers.h:48,
                 from /usr/include/gtest/internal/gtest-death-test-internal.h:47,
                 from /usr/include/gtest/gtest-death-test.h:43,
                 from /usr/include/gtest/gtest.h:65:
/usr/include/gtest/internal/gtest-internal.h:636:58: error: wrong number of template arguments (0, should be 1)
  636 |   typedef ::std::map<std::string, CodeLocation, std::less<>> RegisteredTestsMap;
      |                                                          ^

I have therefore run

sed -i 's/ -std=c++11 / -std=c++14 /' unit_tests/Makefile

And things work again now.

ccorn avatar Jan 22 '23 19:01 ccorn