Constrain and warn GCC 8 bug

This commit is contained in:
Florian Rupprecht 2021-11-25 15:14:45 +01:00
parent 7a0576546c
commit 58e211355f
2 changed files with 7 additions and 3 deletions

View File

@ -82,7 +82,7 @@ namespace crow
///Create a route using a rule (**Use CROW_ROUTE instead**) ///Create a route using a rule (**Use CROW_ROUTE instead**)
template <uint64_t Tag> template <uint64_t Tag>
#ifdef CROW_GCC8_WORKAROUND #ifdef CROW_GCC83_WORKAROUND
auto& route(std::string&& rule) auto& route(std::string&& rule)
#else #else
auto route(std::string&& rule) auto route(std::string&& rule)

View File

@ -58,6 +58,10 @@
#endif #endif
#endif #endif
#if __GNUC__ == 8 && __cplusplus > 201103L #if __GNUC__ == 8 && __GNUC_MINOR__ < 4
#define CROW_GCC8_WORKAROUND #if __cplusplus > 201103L
#define CROW_GCC83_WORKAROUND
#else
#warning "GCC 8.1 - 8.3 have a bug that prevents crow from compiling with C++11. Please update GCC to > 8.3 or use C++ > 11."
#endif
#endif #endif