Summary:
Converting an enum class to a string fails with clang.
Adfinder clang build failure is http://ci-fbcode.fb.com:8080/builders/project/builds/146520/steps/build/logs/stdio
Our version of clang supports std::underlying_type so use that implementation instead.
Test Plan:
fbconfig -r folly && fbmake runtests (only failure is folly/experimental/symbolizer/test:symbolizer_test which failed before this diff)
fbconfig --clang folly/test:conv_test && fbmake runtests (fbconfig -r --clang folly fails and fbconfig --clang folly/test && fbmake has some unrelated compile errors)
Build adfinder with clang
Reviewed By: delong.j@fb.com
FB internal diff:
D1178770
toAppend<Tgt>(static_cast<Intermediate>(value), result);
}
-#if defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
+#if defined(__clang__) || __GNUC_PREREQ(4, 7)
// std::underlying_type became available by gcc 4.7.0
/**
* Enum to anything and back
******************************************************************************/
-#if defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
+#if defined(__clang__) || __GNUC_PREREQ(4, 7)
// std::underlying_type became available by gcc 4.7.0
template <class Tgt, class Src>
}
}
-#if defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
+#if defined(__clang__) || __GNUC_PREREQ(4, 7)
// to<enum class> and to(enum class) only supported in gcc 4.7 onwards
TEST(Conv, UnsignedEnumClass) {