Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTest now requires C++14 #24

Open
ccorn opened this issue Jan 22, 2023 · 0 comments
Open

GTest now requires C++14 #24

ccorn opened this issue Jan 22, 2023 · 0 comments

Comments

@ccorn
Copy link

ccorn commented Jan 22, 2023

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 ccorn changed the title GTest GTest now requires C++14 Jan 22, 2023
@ccorn ccorn mentioned this issue Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant