LoginSignup
3

More than 5 years have passed since last update.

コンパイラのデフォルトC++バージョン

Posted at

メモを供養

GCC

バージョン6からC++14(+GNU拡張)がデフォルトになっており、それ以前はC++98(+GNU拡張)だった。

Caveats
- The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98.

Clang

バージョン6からC++14(+GNU拡張)がデフォルトになっており、それ以前はC++98(+GNU拡張)だった。

C++ Language Changes in Clang
- Clang’s default C++ dialect is now gnu++14 instead of gnu++98. This means Clang will by default accept code using features from C++14 and conforming GNU extensions. Projects incompatible with C++14 can add -std=gnu++98 to their build settings to restore the previous behaviour.

まとめ

どちらもバージョン6から-std=gnu++14がデフォルト、それ以前は-std=gnu++98がデフォルト。
覚えやすい。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3