I am trying to test the version of libstdc++
because std::regex
is implemented, but largely broken, in the versions of libstdc++
distributed with GCC before version 4.9.0.
Note that:
I need to test the version of
libstdc++
, not GCC because Clang also supports usinglibstdc++
as the standard library. This rules out testing the__GNUC_PATCHLEVEL__
,__GNUC__
, and__GNUC_MINOR__
macros.The
__GLIBCXX__
macro is a date, not a version number and does not increase monotonically. For example, GCC 4.8.4 ships with#define __GLIBCXX__ 20150426
, which is newer than the release date of GCC 4.9.0.
Is there any portable way to test the version of libstdc++
that does not depend on using GCC my compiler?