20

This is not a question about which c++11 features are supported by gcc (I believe since 4.8 the c++11 support is pretty complete), but if there are any known problems in using them in production code.

The reason I'm asking is that I had a look at the manual for gcc5.2 and in the section "Language Standards Supported by GCC" it reads:

[...] most of which have been implemented in an experimental C++11 mode in GCC.

That word experimental got me a little worried, but on the other hand, c++14 isn't even mentioned, although I believe GCC supports all of those features, too. So is this just an oversight in the documentation or are there really any valid concerns against using c++11 features in production code that will be compiled with gcc5.2 (4.8)?

MikeMB
  • 20,029
  • 9
  • 57
  • 102
  • Related: [When will Gnu C++ support C++11 without explicitly asking for it?](http://stackoverflow.com/q/21221411/86967). – Brent Bradburn Oct 20 '15 at 14:12
  • I run across the same isue. I though that c++11 was fully supported in gcc (specially in 2016!) .. but it's still tagged as experimental .. – rkachach Jun 10 '16 at 11:12

1 Answers1

12

Looks like actually it's experimental only on words. In gcc 6.0 it will not be experimental more.

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

But now, default mode is gnu++98 and so, it's experimental (one of the reasons, why we don't use C++11/C++14 now).

ForEveR
  • 55,233
  • 2
  • 119
  • 133
  • 6
    Wait, really? You don't use C++11 because the compiler forces you to pass `-std` flags to it? /pity. – Yakk - Adam Nevraumont Oct 20 '15 at 14:18
  • 2
    @Yakk one of the reasons, but not because `-std` flag. Because `expiremental` word. And yeah, I don't like it.) But boost helps. – ForEveR Oct 20 '15 at 14:19
  • Any infos on when gcc 6.0 is supposed to be released? – MikeMB Oct 20 '15 at 14:23
  • Regarding the default mode, I didn't actually expect them to change it as the didn't even change to c++03 in the past. – MikeMB Oct 20 '15 at 14:25
  • @MikeMB no information. But: https://gcc.gnu.org/ml/gcc/2015-10/msg00113.html and so on about dev steps: https://gcc.gnu.org/develop.html – ForEveR Oct 20 '15 at 14:27
  • 1
    @MikeMB C++03 was subsumed into C++98 mode (they are identical under both clang and gcc: C++03 is considered bug fixes on C++98, which I figured out researching [this answer](http://codegolf.stackexchange.com/a/48924/23424)) – Yakk - Adam Nevraumont Oct 20 '15 at 14:34
  • 1
    @Yakk: Thanks for the clarification, I wasn't aware of that. – MikeMB Oct 20 '15 at 18:41
  • @ForEveR: Have you encountered any actual problems in c++11/14 mode or is it just company policy to not use anything labeled *experimental*? – MikeMB Oct 20 '15 at 18:41
  • @MikeMB was one problem with libraries builded with C++03 and core project builded with C++11. http://stackoverflow.com/questions/28211746/how-to-catch-strange-undefined-behaviour-in-c-code , after that C++11 was disabled due `expiremental` word. – ForEveR Oct 21 '15 at 05:47
  • Well, I understand your case. Relying on a support that's tagged as "experimental" explicitly in the user manual of gcc is not sane for production environments. – rkachach Jun 10 '16 at 11:10