facebook / fbthrift

Facebook's branch of Apache Thrift, including a new C++ server.
Apache License 2.0
2.57k stars 608 forks source link

build error with gcc 5.4.0 #337

Closed silveric10 closed 5 years ago

silveric10 commented 5 years ago

You can see may gcc version root@ubuntu:/home/yy/openr/build# gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

But there are those errors: Scanning dependencies of target thrift-core [ 37%] Building CXX object thrift/lib/cpp/CMakeFiles/thrift-core.dir/Thrift.cpp.o In file included from /usr/local/include/folly/Range.h:22:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.h:20, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:21: /usr/local/include/folly/Portability.h:22:1: error: static assertion failed: cplusplus >= 201402L static_assert(cplusplus >= 201402L, "cplusplus >= 201402L"); ^ In file included from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.h:20:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:21: /usr/local/include/folly/Range.h:522:12: error: ‘std::enable_if_t’ has not been declared std::enable_if_t< ^ /usr/local/include/folly/Range.h:522:23: error: expected ‘>’ before ‘<’ token std::enable_if_t< ^ /usr/local/include/folly/Range.h:532:12: error: ‘std::enable_if_t’ has not been declared std::enable_if_t< ^ /usr/local/include/folly/Range.h:532:23: error: expected ‘>’ before ‘<’ token std::enable_if_t< ^ /usr/local/include/folly/Range.h:537:22: error: ‘template template<class Tgt, int > constexpr folly::Range::operator Tgt() const’ cannot be overloaded constexpr explicit operator Tgt() const noexcept( ^ /usr/local/include/folly/Range.h:526:22: error: with ‘template template<class Tgt, int > constexpr folly::Range::operator Tgt() const’ constexpr explicit operator Tgt() const noexcept( ^ /usr/local/include/folly/Range.h:575:18: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type constexpr std::enable_if_t< ^ /usr/local/include/folly/Range.h:584:18: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type constexpr std::enable_if_t< ^ /usr/local/include/folly/Range.h: In member function ‘std::cxx11::string folly::Range::str() const’: /usr/local/include/folly/Range.h:596:12: error: ‘to’ was not declared in this scope return to(); ^ /usr/local/include/folly/Range.h:596:26: error: expected primary-expression before ‘>’ token return to(); ^ /usr/local/include/folly/Range.h:596:28: error: expected primary-expression before ‘)’ token return to(); ^ /usr/local/include/folly/Range.h: In member function ‘std::cxx11::string folly::Range::toString() const’: /usr/local/include/folly/Range.h:599:12: error: ‘to’ was not declared in this scope return to(); ^ /usr/local/include/folly/Range.h:599:26: error: expected primary-expression before ‘>’ token return to(); ^ /usr/local/include/folly/Range.h:599:28: error: expected primary-expression before ‘)’ token return to(); ^ /usr/local/include/folly/Range.h: At global scope: /usr/local/include/folly/Range.h:1242:6: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator==( ^ /usr/local/include/folly/Range.h:1252:6: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator!=( ^ /usr/local/include/folly/Range.h:1262:6: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator<( ^ /usr/local/include/folly/Range.h:1272:6: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator>( ^ /usr/local/include/folly/Range.h:1282:6: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator<=( ^ /usr/local/include/folly/Range.h:1292:6: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type std::enable_if_t<detail::ComparableAsStringPiece<T, U>::value, bool> operator>=( ^ /usr/local/include/folly/Range.h:1503:5: error: ‘enable_if_t’ is not a member of ‘std’ std::enable_if_t<std::is_integral::value, void>> { ^ /usr/local/include/folly/Range.h:1503:5: error: ‘enable_if_t’ is not a member of ‘std’ /usr/local/include/folly/Range.h:1503:50: error: wrong number of template arguments (3, should be 2) std::enable_if_t<std::is_integral::value, void>> { ^ /usr/local/include/folly/Range.h:1498:8: note: provided for ‘template<class Key, class Enable> struct folly::hasher’ struct hasher; ^ /usr/local/include/folly/Range.h:1503:54: error: expected unqualified-id before ‘>’ token std::enable_if_t<std::is_integral::value, void>> { ^ In file included from /usr/local/include/folly/lang/Bits.h:60:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.h:22, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:21: /usr/local/include/folly/ConstexprMath.h: In function ‘constexpr std::size_t folly::constexpr_find_last_set(T)’: /usr/local/include/folly/ConstexprMath.h:151:18: error: ‘make_unsigned_t’ in namespace ‘std’ does not name a template type using U = std::make_unsigned_t; ^ /usr/local/include/folly/ConstexprMath.h:152:57: error: ‘U’ does not name a type return t == T(0) ? 0 : 1 + constexpr_log2(static_cast(t)); ^ /usr/local/include/folly/ConstexprMath.h: In function ‘constexpr std::size_t folly::constexpr_find_first_set(T)’: /usr/local/include/folly/ConstexprMath.h:171:18: error: ‘make_unsigned_t’ in namespace ‘std’ does not name a template type using U = std::make_unsigned_t; ^ /usr/local/include/folly/ConstexprMath.h:175:70: error: ‘U’ does not name a type : 1 + detail::constexpr_find_firstset(size{}, 0, static_cast(t)); ^ In file included from /usr/local/include/folly/lang/Bits.h:63:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.h:22, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:21: /usr/local/include/folly/Utility.h: At global scope: /usr/local/include/folly/Utility.h:309:16: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type constexpr std::underlying_type_t to_underlying_type(E e) noexcept { ^ In file included from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.h:22:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:21: /usr/local/include/folly/lang/Bits.h:79:10: error: ‘std::enable_if_t’ has not been declared std::enable_if_t< ^ /usr/local/include/folly/lang/Bits.h:79:21: error: expected ‘>’ before ‘<’ token std::enable_if_t< ^ /usr/local/include/folly/lang/Bits.h:93:16: error: ‘make_signed_t’ in namespace ‘std’ does not name a template type constexpr std::make_signed_t bits_to_signed(Src const s) { ^ /usr/local/include/folly/lang/Bits.h:98:16: error: ‘make_unsigned_t’ in namespace ‘std’ does not name a template type constexpr std::make_unsigned_t bits_to_unsigned(Src const s) { ^ /usr/local/include/folly/lang/Bits.h: In function ‘constexpr unsigned int folly::findFirstSet(T)’: /usr/local/include/folly/lang/Bits.h:113:17: error: ‘folly::detail::bits_to_signed’ has not been declared using detail::bits_to_signed; ^ /usr/local/include/folly/lang/Bits.h:120:47: error: ‘bits_to_signed’ was not declared in this scope sizeof(T) <= sizeof(S0) ? __builtin_ffs(bits_to_signed(v)) : ^ /usr/local/include/folly/lang/Bits.h:120:64: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(S0) ? builtin_ffs(bits_to_signed(v)) : ^ /usr/local/include/folly/lang/Bits.h:121:65: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(S1) ? builtin_ffsl(bits_to_signed(v)) : ^ /usr/local/include/folly/lang/Bits.h:122:66: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(S2) ? __builtin_ffsll(bits_to_signed(v)) : ^ /usr/local/include/folly/lang/Bits.h: In function ‘constexpr unsigned int folly::findLastSet(T)’: /usr/local/include/folly/lang/Bits.h:136:17: error: ‘folly::detail::bits_to_unsigned’ has not been declared using detail::bits_to_unsigned; ^ /usr/local/include/folly/lang/Bits.h:146:47: error: ‘bits_to_unsigned’ was not declared in this scope sizeof(T) <= sizeof(U0) ? builtin_clz(bits_to_unsigned(v)) : ^ /usr/local/include/folly/lang/Bits.h:146:66: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(U0) ? builtin_clz(bits_to_unsigned(v)) : ^ /usr/local/include/folly/lang/Bits.h:147:67: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(U1) ? __builtin_clzl(bits_to_unsigned(v)) : ^ /usr/local/include/folly/lang/Bits.h:148:68: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(U2) ? builtin_clzll(bits_to_unsigned(v)) : ^ /usr/local/include/folly/lang/Bits.h: In function ‘constexpr unsigned int folly::popcount(T)’: /usr/local/include/folly/lang/Bits.h:173:17: error: ‘folly::detail::bits_to_unsigned’ has not been declared using detail::bits_to_unsigned; ^ /usr/local/include/folly/lang/Bits.h:180:52: error: ‘bits_to_unsigned’ was not declared in this scope sizeof(T) <= sizeof(U0) ? builtin_popcount(bits_to_unsigned(v)) : ^ /usr/local/include/folly/lang/Bits.h:180:71: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(U0) ? __builtin_popcount(bits_to_unsigned(v)) : ^ /usr/local/include/folly/lang/Bits.h:181:72: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(U1) ? builtin_popcountl(bits_to_unsigned(v)) : ^ /usr/local/include/folly/lang/Bits.h:182:73: error: expected primary-expression before ‘>’ token sizeof(T) <= sizeof(U2) ? __builtin_popcountll(bits_to_unsigned(v)) : ^ In file included from /usr/local/include/folly/hash/Hash.h:29:0, from /usr/local/include/folly/FBString.h:59, from /usr/local/include/folly/Demangle.h:19, from /usr/local/include/folly/Conv.h:40, from /usr/local/include/folly/String.h:27, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:25: /usr/local/include/folly/functional/ApplyTuple.h: At global scope: /usr/local/include/folly/functional/ApplyTuple.h:36:10: error: ‘make_index_sequence’ in namespace ‘std’ does not name a template type std::make_index_sequence<std::tuple_size::value>; ^ /usr/local/include/folly/functional/ApplyTuple.h:45:15: error: ‘index_sequence_for_tuple’ does not name a type using seq = index_sequence_for_tuple<std::remove_reference_t>; ^ /usr/local/include/folly/functional/ApplyTuple.h:49:30: error: ‘std::indexsequence’ has not been declared invoke(F&& f, T&& t, std::indexsequence<I...>) noexcept( ^ /usr/local/include/folly/functional/ApplyTuple.h:49:44: error: expected ‘,’ or ‘...’ before ‘<’ token invoke(F&& f, T&& t, std::index_sequence<I...>) noexcept( ^ /usr/local/include/folly/functional/ApplyTuple.h:61:40: error: ‘std::index_sequence’ has not been declared auto forward_tuple(Tuple&& tuple, std::index_sequence) ^ /usr/local/include/folly/functional/ApplyTuple.h:61:54: error: expected ‘,’ or ‘...’ before ‘<’ token auto forward_tuple(Tuple&& tuple, std::indexsequence) ^ /usr/local/include/folly/functional/ApplyTuple.h:73:66: error: ‘seq’ was not declared in this scope noexcept(invoke(static_cast<F&&>(f), staticcast<T&&>(t), seq{}))) ^ /usr/local/include/folly/functional/ApplyTuple.h:73:71: error: expected primary-expression before ‘>’ token noexcept(invoke(static_cast<F&&>(f), staticcast<T&&>(t), seq{}))) ^ /usr/local/include/folly/functional/ApplyTuple.h:73:72: error: expected primary-expression before ‘{’ token noexcept(invoke(static_cast<F&&>(f), staticcast<T&&>(t), seq{}))) ^ /usr/local/include/folly/functional/ApplyTuple.h:74:69: error: ‘seq’ was not declared in this scope -> decltype(invoke(static_cast<F&&>(f), staticcast<T&&>(t), seq{})) { ^ /usr/local/include/folly/functional/ApplyTuple.h:74:69: error: ‘seq’ was not declared in this scope /usr/local/include/folly/functional/ApplyTuple.h:74:74: error: expected primary-expression before ‘>’ token -> decltype(invoke(static_cast<F&&>(f), staticcast<T&&>(t), seq{})) { ^ /usr/local/include/folly/functional/ApplyTuple.h:74:75: error: expected primary-expression before ‘{’ token -> decltype(invoke(static_cast<F&&>(f), static_cast<T&&>(t), seq{})) { ^ /usr/local/include/folly/functional/ApplyTuple.h: In member function ‘constexpr decltype (folly::detail::applytuple::adl::ApplyInvoke::invoke(static_cast<F&&>(f), staticcast<T&&>(t), )) folly::ApplyInvoke::operator()(F&&, T&&) const’: /usr/local/include/folly/functional/ApplyTuple.h:75:62: error: ‘seq’ was not declared in this scope return invoke(static_cast<F&&>(f), staticcast<T&&>(t), seq{}); ^ /usr/local/include/folly/functional/ApplyTuple.h:75:67: error: expected primary-expression before ‘>’ token return invoke(static_cast<F&&>(f), staticcast<T&&>(t), seq{}); ^ /usr/local/include/folly/functional/ApplyTuple.h:75:68: error: expected primary-expression before ‘{’ token return invoke(static_cast<F&&>(f), static_cast<T&&>(t), seq{}); ^ /usr/local/include/folly/functional/ApplyTuple.h: At global scope: /usr/local/include/folly/functional/ApplyTuple.h:95:20: error: expected primary-expression before ‘auto’ constexpr decltype(auto) apply(F&& func, Tuple&& tuple) { ^ /usr/local/include/folly/functional/ApplyTuple.h:95:20: error: expected ‘)’ before ‘auto’ /usr/local/include/folly/functional/ApplyTuple.h:95:11: error: expected unqualified-id before ‘decltype’ constexpr decltype(auto) apply(F&& func, Tuple&& tuple) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:13: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:38: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:67: error: expected primary-expression before ‘>’ token index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:69: error: expected primary-expression before ‘>’ token index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h:122:71: error: expected primary-expression before ‘)’ token index_sequence_for_tuple<std::remove_reference_t>>())) { ^ /usr/local/include/folly/functional/ApplyTuple.h: In function ‘decltype (folly::detail::apply_tuple::adl::forward_tuple(declval(), )) folly::forward_tuple(Tuple&&)’: /usr/local/include/folly/functional/ApplyTuple.h:125:7: error: ‘index_sequence_for_tuple’ was not declared in this scope index_sequence_for_tuple<std::remove_reference_t>{}); ^ /usr/local/include/folly/functional/ApplyTuple.h:125:32: error: ‘remove_reference_t’ is not a member of ‘std’ index_sequence_for_tuple<std::remove_reference_t>{}); ^ /usr/local/include/folly/functional/ApplyTuple.h:125:61: error: expected primary-expression before ‘>>’ token index_sequence_for_tuple<std::remove_reference_t>{}); ^ /usr/local/include/folly/functional/ApplyTuple.h:125:63: error: expected primary-expression before ‘{’ token index_sequence_for_tuple<std::remove_reference_t>{}); ^ In file included from /usr/local/include/folly/FBString.h:59:0, from /usr/local/include/folly/Demangle.h:19, from /usr/local/include/folly/Conv.h:40, from /usr/local/include/folly/String.h:27, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:25: /usr/local/include/folly/hash/Hash.h: At global scope: /usr/local/include/folly/hash/Hash.h:511:18: error: ‘enable_if_t’ is not a member of ‘std’ struct hasher<T, std::enable_if_t<std::is_enum::value>> { ^ /usr/local/include/folly/hash/Hash.h:511:18: error: ‘enable_if_t’ is not a member of ‘std’ /usr/local/include/folly/hash/Hash.h:511:52: error: type/value mismatch at argument 2 in template parameter list for ‘template<class Key, class Enable> struct folly::hasher’ struct hasher<T, std::enable_if_t<std::is_enum::value>> { ^ /usr/local/include/folly/hash/Hash.h:511:52: note: expected a type, got ‘( < std::is_enum<_Tp>::value)’ /usr/local/include/folly/hash/Hash.h:511:57: error: expected unqualified-id before ‘>’ token struct hasher<T, std::enable_if_t<std::is_enum::value>> { ^ /usr/local/include/folly/hash/Hash.h:519:15: error: ‘enable_if_t’ is not a member of ‘std’ hasher<T, std::enable_if_t<std::is_enum::value>>, ^ /usr/local/include/folly/hash/Hash.h:519:15: error: ‘enable_if_t’ is not a member of ‘std’ /usr/local/include/folly/hash/Hash.h:519:49: error: type/value mismatch at argument 2 in template parameter list for ‘template<class Key, class Enable> struct folly::hasher’ hasher<T, std::enable_if_t<std::is_enum::value>>, ^ /usr/local/include/folly/hash/Hash.h:519:49: note: expected a type, got ‘( < std::is_enum<_Tp>::value)’ /usr/local/include/folly/hash/Hash.h:519:54: error: wrong number of template arguments (1, should be 2) hasher<T, std::enable_if_t<std::is_enum::value>>, ^ /usr/local/include/folly/hash/Hash.h:412:8: note: provided for ‘template<class Hasher, class Key> struct folly::IsAvalanchingHasher’ struct IsAvalanchingHasher; ^ /usr/local/include/folly/hash/Hash.h:731:23: error: ‘decay_t’ in namespace ‘std’ does not name a template type using FirstT = std::decay_t<std::tuple_element_t<0, std::tuple<Ts..., bool>>>; ^ /usr/local/include/folly/hash/Hash.h:736:44: error: ‘FirstT’ was not declared in this scope folly::IsAvalanchingHasher<std::hash, FirstT>::value)>; ^ /usr/local/include/folly/hash/Hash.h:736:50: error: template argument 1 is invalid folly::IsAvalanchingHasher<std::hash, FirstT>::value)>; ^ /usr/local/include/folly/hash/Hash.h:736:53: error: ‘FirstT’ was not declared in this scope folly::IsAvalanchingHasher<std::hash, FirstT>::value)>; ^ /usr/local/include/folly/hash/Hash.h:736:59: error: template argument 1 is invalid folly::IsAvalanchingHasher<std::hash, FirstT>::value)>; ^ /usr/local/include/folly/hash/Hash.h:736:59: error: template argument 2 is invalid /usr/local/include/folly/hash/Hash.h:736:68: error: template argument 1 is invalid folly::IsAvalanchingHasher<std::hash, FirstT>::value)>; ^ In file included from /usr/local/include/folly/Expected.h:34:0, from /usr/local/include/folly/Conv.h:41, from /usr/local/include/folly/String.h:27, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:25: /usr/local/include/folly/Optional.h:263:20: error: ‘constexpr Value& folly::Optional::value() const &’ cannot be overloaded constexpr Value& value() & { ^ /usr/local/include/folly/Optional.h:258:26: error: with ‘constexpr const Value& folly::Optional::value() const &’ constexpr const Value& value() const& { ^ /usr/local/include/folly/Optional.h:273:27: error: ‘constexpr const Value&& folly::Optional::value() const &&’ cannot be overloaded constexpr const Value&& value() const&& { ^ /usr/local/include/folly/Optional.h:268:21: error: with ‘constexpr Value&& folly::Optional::value() const &&’ constexpr Value&& value() && { ^ /usr/local/include/folly/Optional.h:301:20: error: ‘constexpr Value& folly::Optional::operator() const &’ cannot be overloaded constexpr Value& operator() & { ^ /usr/local/include/folly/Optional.h:298:26: error: with ‘constexpr const Value& folly::Optional::operator() const &’ constexpr const Value& operator() const& { ^ /usr/local/include/folly/Optional.h:307:21: error: ‘constexpr Value&& folly::Optional::operator() const &&’ cannot be overloaded constexpr Value&& operator() && { ^ /usr/local/include/folly/Optional.h:304:27: error: with ‘constexpr const Value&& folly::Optional::operator() const &&’ constexpr const Value&& operator() const&& { ^ /usr/local/include/folly/Optional.h:314:20: error: ‘constexpr Value folly::Optional::operator->() const’ cannot be overloaded constexpr Value operator->() { ^ /usr/local/include/folly/Optional.h:311:26: error: with ‘constexpr const Value folly::Optional::operator->() const’ constexpr const Value operator->() const { ^ /usr/local/include/folly/Optional.h:339:29: error: ‘decay_t’ is not a member of ‘std’ friend constexpr Optional<std::decay_t> make_optional(T&&); ^ /usr/local/include/folly/Optional.h:339:29: error: ‘decay_t’ is not a member of ‘std’ /usr/local/include/folly/Optional.h:339:42: error: template argument 1 is invalid friend constexpr Optional<std::decay_t> make_optional(T&&); ^ /usr/local/include/folly/Optional.h:339:43: error: expected unqualified-id before ‘>’ token friend constexpr Optional<std::decay_t> make_optional(T&&); ^ /usr/local/include/folly/Optional.h: In constructor ‘folly::Optional::Optional(Value&&)’: /usr/local/include/folly/Optional.h:129:3: error: constexpr constructor does not have empty body } ^ /usr/local/include/folly/Optional.h: In constructor ‘folly::Optional::Optional(const Value&)’: /usr/local/include/folly/Optional.h:134:3: error: constexpr constructor does not have empty body } ^ /usr/local/include/folly/Optional.h: In constructor ‘folly::Optional::Optional(folly::Optional::PrivateConstructor, Args&& ...)’: /usr/local/include/folly/Optional.h:360:3: error: constexpr constructor does not have empty body } ^ /usr/local/include/folly/Optional.h: At global scope: /usr/local/include/folly/Optional.h:434:20: error: ‘decay_t’ is not a member of ‘std’ constexpr Optional<std::decay_t> make_optional(T&& v) { ^ /usr/local/include/folly/Optional.h:434:20: error: ‘decay_t’ is not a member of ‘std’ /usr/local/include/folly/Optional.h:434:33: error: template argument 1 is invalid constexpr Optional<std::decay_t> make_optional(T&& v) { ^ /usr/local/include/folly/Optional.h:434:34: error: expected unqualified-id before ‘>’ token constexpr Optional<std::decay_t> make_optional(T&& v) { ^ In file included from /usr/local/include/folly/Conv.h:49:0, from /usr/local/include/folly/String.h:27, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:25: /usr/local/include/folly/lang/Pretty.h:79:33: error: ‘conditional_t’ in namespace ‘std’ does not name a template type using pretty_default_tag = std::conditional_t< // ^ /usr/local/include/folly/lang/Pretty.h:85:48: error: ‘pretty_raw’ function uses ‘auto’ type specifier without trailing return type static constexpr auto pretty_raw(pretty_tag_msc) { ^ /usr/local/include/folly/lang/Pretty.h:85:48: note: deduced return type only available with -std=c++14 or -std=gnu++14 /usr/local/include/folly/lang/Pretty.h:92:48: error: ‘pretty_raw’ function uses ‘auto’ type specifier without trailing return type static constexpr auto pretty_raw(pretty_taggcc) { ^ /usr/local/include/folly/lang/Pretty.h:92:48: note: deduced return type only available with -std=c++14 or -std=gnu++14 /usr/local/include/folly/lang/Pretty.h:122:30: error: ‘raw’ function uses ‘auto’ type specifier without trailing return type static constexpr auto raw() { ^ /usr/local/include/folly/lang/Pretty.h:122:30: note: deduced return type only available with -std=c++14 or -std=gnu++14 /usr/local/include/folly/lang/Pretty.h:129:33: error: ‘zarray’ function uses ‘auto’ type specifier without trailing return type static constexpr auto zarray_() { ^ /usr/local/include/folly/lang/Pretty.h:129:33: note: deduced return type only available with -std=c++14 or -std=gnu++14 /usr/local/include/folly/lang/Pretty.h: In function ‘constexpr const char folly::pretty_name()’: /usr/local/include/folly/lang/Pretty.h:156:40: error: ‘pretty_default_tag’ is not a member of ‘folly::detail’ return detail::pretty_name_zarray<T, detail::pretty_default_tag>::zarray.data; ^ /usr/local/include/folly/lang/Pretty.h:156:40: error: ‘pretty_default_tag’ is not a member of ‘folly::detail’ /usr/local/include/folly/lang/Pretty.h:156:66: error: template argument 2 is invalid return detail::pretty_name_zarray<T, detail::pretty_default_tag>::zarray.data; ^ In file included from /usr/local/include/folly/String.h:27:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:25: /usr/local/include/folly/Conv.h: In function ‘typename std::enable_if<(((std::is_integral<_Tp2>::value && (! std::is_same< , >::value)) && (! std::is_same<T, bool>::value)) && std::is_integral<_Tp>::value), folly::Expected<Tgt, folly::ConversionCode> >::type folly::detail::convertTo(const Src&)’: /usr/local/include/folly/Conv.h:1219:7: error: ‘make_unsigned_t’ is not a member of ‘std’ std::make_unsigned_t(std::numeric_limits::max()) < ^ /usr/local/include/folly/Conv.h:1219:31: error: expected primary-expression before ‘>’ token std::make_unsigned_t(std::numeric_limits::max()) < ^ /usr/local/include/folly/Conv.h:1220:7: error: ‘make_unsigned_t’ is not a member of ‘std’ std::make_unsigned_t(std::numeric_limits::max())) { ^ /usr/local/include/folly/Conv.h:1220:31: error: expected primary-expression before ‘>’ token std::make_unsigned_t(std::numeric_limits::max())) { ^ In file included from /usr/local/include/folly/String.h:28:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:25: /usr/local/include/folly/ExceptionString.h: In lambda function: /usr/local/include/folly/ExceptionString.h:52:16: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14 [](auto&& e) { return exceptionStr(e); }); ^ /usr/local/include/folly/ExceptionString.h: In lambda function: /usr/local/include/folly/ExceptionString.h:52:49: error: no matching function for call to ‘exceptionStr(int&)’ [](auto&& e) { return exceptionStr(e); }); ^ /usr/local/include/folly/ExceptionString.h:33:17: note: candidate: folly::fbstring folly::exceptionStr(const std::exception&) inline fbstring exceptionStr(const std::exception& e) { ^ /usr/local/include/folly/ExceptionString.h:33:17: note: no known conversion for argument 1 from ‘int’ to ‘const std::exception&’ /usr/local/include/folly/ExceptionString.h:44:17: note: candidate: folly::fbstring folly::exceptionStr(std::exception_ptr::exception_ptr) inline fbstring exceptionStr(std::exception_ptr ep) { ^ /usr/local/include/folly/ExceptionString.h:44:17: note: no known conversion for argument 1 from ‘int’ to ‘std::__exception_ptr::exception_ptr’ /usr/local/include/folly/ExceptionString.h: In lambda function: /usr/local/include/folly/ExceptionString.h:52:53: error: no matching function for call to ‘catch_exception(folly::exceptionStr(std::exception_ptr::exception_ptr)::<lambda()>::<lambda()>, folly::exceptionStr(std::__exception_ptr::exception_ptr)::<lambda()>::<lambda(int&&)>)’ [](auto&& e) { return exceptionStr(e); }); ^ In file included from /usr/local/include/folly/Range.h:24:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.h:20, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:21: /usr/local/include/folly/lang/Exception.h:186:1: note: candidate: template<class E, class Try, class Catch, class ... CatchA> typename std::common_type<decltype (static_cast<Try&&>(t)()), decltype (static_cast<Catch&&>(c)(declval(), static_cast<CatchA&>(folly::catch_exception::a) ...))>::type folly::catch_exception(Try&&, Catch&&, CatchA&& ...) catch_exception(Try&& t, Catch&& c, CatchA&&... a) -> typename std::common_type< ^ /usr/local/include/folly/lang/Exception.h:186:1: note: template argument deduction/substitution failed: /usr/local/include/folly/lang/Exception.h: In substitution of ‘template<class E, class Try, class Catch, class ... CatchA> typename std::common_type<decltype (static_cast<Try&&>(t)()), decltype (static_cast<Catch&&>(c)(declval(), static_cast<CatchA&>(folly::catch_exception::a) ...))>::type folly::catch_exception(Try&&, Catch&&, CatchA&& ...) [with E = const std::exception&; Try = folly::exceptionStr(std::exception_ptr::exception_ptr)::<lambda()>::<lambda()>; Catch = folly::exceptionStr(std::exception_ptr::exception_ptr)::<lambda()>::<lambda(int&&)>; CatchA = {}]’: /usr/local/include/folly/ExceptionString.h:52:53: required from here /usr/local/include/folly/lang/Exception.h:189:11: error: no match for call to ‘(folly::exceptionStr(std::__exception_ptr::exception_ptr)::<lambda()>::<lambda(int&&)>) (const std::exception&)’ c)(std::declval(), static_cast<CatchA&&>(a)...))>::type { ^ /usr/local/include/folly/lang/Exception.h:189:11: note: candidate: void ()(int&&) /usr/local/include/folly/lang/Exception.h:189:11: note: candidate expects 2 arguments, 2 provided In file included from /usr/local/include/folly/String.h:28:0, from /home/yy/openr/build/deps/fbthrift/thrift/lib/cpp/Thrift.cpp:25: /usr/local/include/folly/ExceptionString.h:52:24: note: candidate: folly::exceptionStr(std::__exception_ptr::exception_ptr)::<lambda()>::<lambda(int&&)> [](auto&& e) { return exceptionStr(e); }); ^ /usr/local/include/folly/ExceptionString.h:52:24: note: no known conversion for argument 1 from ‘const std::exception’ to ‘int&&’ In file included from /usr/local/include/folly/Range.h:24:0,

Please help!

avalonalex commented 5 years ago

I believe the minimum gcc version required is now 7 since this.

vitaut commented 5 years ago

Also the error is in Folly, not in Thrift.

yfeldblum commented 5 years ago

Thrift currently builds with gcc5, although that will not be kept long term.

Here is the key line:

folly/Portability.h:22:1: error: static assertion failed: __cplusplus >= 201402L

You must build Folly (and therefore Thrift) in C++14 mode or later, e.g. with gcc via -std=c++14.

silveric10 commented 5 years ago

Thrift currently builds with gcc5, although that will not be kept long term. Here is the key line: folly/Portability.h:22:1: error: static assertion failed: __cplusplus >= 201402L

You must build Folly (and therefore Thrift) in C++14 mode or later, e.g. with gcc via -std=c++14.

But after I update the gcc to version 7.4, this issue is still there.