libstdc++ comes with GCC, so the correct way is to check the GCC version, by testing its __GNUC__
, __GNUC_MINOR__
and __GNUC_PATCHLEVEL__
predefined macros.
If you're using libstdc++ with Clang you could test whether __GLIBCXX__ > 20131020UL
which is the date the bug was fixed. A release after that date should contain the fix.