mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 21:16:56 +00:00
Patch compiler error when building using nvcc
If you compile using `nvcc` and pass the option `--expt-relaxed-constexpr` it will crash with an internal compiler error. This modification prevents using `constexpr` in `fmtlib` when compiling using `nvcc` and prevents the crash.
This commit is contained in:
parent
d39ebf3ff2
commit
00669427df
@ -58,10 +58,12 @@
|
|||||||
// Check if relaxed C++14 constexpr is supported.
|
// Check if relaxed C++14 constexpr is supported.
|
||||||
// GCC doesn't allow throw in constexpr until version 6 (bug 67371).
|
// GCC doesn't allow throw in constexpr until version 6 (bug 67371).
|
||||||
#ifndef FMT_USE_CONSTEXPR
|
#ifndef FMT_USE_CONSTEXPR
|
||||||
|
#if !defined(__NVCC__)
|
||||||
# define FMT_USE_CONSTEXPR \
|
# define FMT_USE_CONSTEXPR \
|
||||||
(FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \
|
(FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \
|
||||||
(FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L))
|
(FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L))
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#if FMT_USE_CONSTEXPR
|
#if FMT_USE_CONSTEXPR
|
||||||
# define FMT_CONSTEXPR constexpr
|
# define FMT_CONSTEXPR constexpr
|
||||||
# define FMT_CONSTEXPR_DECL constexpr
|
# define FMT_CONSTEXPR_DECL constexpr
|
||||||
|
Loading…
Reference in New Issue
Block a user