I was investigating why this piece of code compiles on my PC that has GCC v7.2, but doesn't compile with our toolchain's GCC v5.4, depsite -std=c++14 -Wpedantic -pedantic-errors
being passed:
#include <array>
#include <vector>
#include <tuple>
typedef std::tuple<const char *, const char *, bool> StrStrBool;
const std::vector<StrStrBool> cApIDValidTestValues {
{
{"str1", "str2", true },
{ "str3", "str4", false }
}
};
The error is:
<source>:12:1: error: converting to 'std::tuple<const char*, const char*, bool>' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {const char (&)[5], const char (&)[5], bool}; <template-parameter-2-2> = void; _Elements = {const char*, const char*, bool}]'
};
^
This code is C++14 valid (explanation), so according to GCC's Standards Support page--which shows full C++14 support since GCC v5--I expected GCC v5.4 to be able to compile it.
But I was told online that it looks like the compiler of this GCC version supports C++14, but the accompanying libstdc++ is not C++14 compliant.
My related questions are:
- What is the earliest GCC version that provides a C++14 compliant libstdc++ ? How do I find this out for other standards too?
- Why would GCC advertise that it has C++14 support for a gcc version, but the libstdc++ shipped with it does not?
- Does this indicate the gcc compiler can be used with other stdlib implementations?