What standard does g++ (10.1) use if none specified?

249 views Asked by At

If --std= is not defined, what C++ standard does g++ 10.1.1 implement?

I couldn't find this in the manual. [Sure it must be somewhere.]

1

There are 1 answers

0
JaMiT On

According to the 10.1 manual (section 2.2 C++ Language, last line):

The default, if no C++ language dialect options are given, is -std=gnu++14.

Admittedly, the URL suggests that this is information for 10.1.0 instead of 10.1.1. It seems unlikely that the default would change for that minor version step, but just in case, here's another reference: C++14 support in GCC with some emphasis added.

This mode is the default in GCC 6.1 and above; it can be explicitly selected with the -std=c++14 command-line flag, or -std=gnu++14 to enable GNU extensions as well.