Skip to content

g++ 14 defaults to C++ 17 #378

@jfpanisset

Description

@jfpanisset

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions