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

The project cannot be built in non-release mode with >=C++20 and GCC #855

Open
Tomaqa opened this issue Jan 18, 2025 · 2 comments · May be fixed by #856
Open

The project cannot be built in non-release mode with >=C++20 and GCC #855

Tomaqa opened this issue Jan 18, 2025 · 2 comments · May be fixed by #856

Comments

@Tomaqa
Copy link

Tomaqa commented Jan 18, 2025

In your project, you use deprecated template-ids within constructors:

.../_deps/marabou-src/src/common/Vector.h:36:14:
warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
   36 |     Vector<T>()

Also, your CMakeLists.txt defines for non-Clang non-release mode the following:

set(COMPILE_FLAGS  -Wall -Wextra -Werror -MMD ) #-Wno-deprecated

This causes the warnings to turn into errors.

Since I used your project as a submodule, I have not figured out how to force a different C++ standard just for your project.
What worked out for me was manually modifying the CMakeLists.txt.

I do not know what is the situation with Clang.

I would suggest either fixing these constructors, using -Wno-template-id-cdtor for GCC (which may not fix it for other compilers), or simply dropping -Werror.

@Tomaqa
Copy link
Author

Tomaqa commented Jan 19, 2025

With GCC13 I experienced that such constructors are not even considered as warnings but directly as errors, so removing -Werror does not resolve the issue there.

@MatthewDaggitt
Copy link
Collaborator

Link to change in standard: http://eel.is/c++draft/diff.cpp17.class#2

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

Successfully merging a pull request may close this issue.

2 participants