-
Notifications
You must be signed in to change notification settings - Fork 41
g++ 14 defaults to C++ 17 #378
Copy link
Copy link
Open
Description
In 2026 images:
[root@ac15caa7e119 aswf]# echo | g++ -dM -E -x c++ - | grep __cplusplus
#define __cplusplus 201703L
[root@ac15caa7e119 aswf]# echo | g++ -dM -E -x c++ -std=c++20 - | grep __cplusplus
#define __cplusplus 202002L
[root@ac15caa7e119 aswf]# g++ --version
g++ (GCC) 14.2.1 20250110 (Red Hat 14.2.1-11)
This is not a problem for Conan builds which set the C++ standard version, but for projects building outside of Conan, they could end up building in C++ 17 mode even in a 2026 container which is supposed to mandate C++ 20.
There doesn't seem to be a simple configuration file / environment variable to set the default C++ mode for g++, perhaps a wrapper around the binary would be needed?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels