Skip to content

Commit ae23fe5

Browse files
committed
Fix error: cannot use 'try' with exceptions disabled in Win LLVM Clang
Fixes #4207. LLVM Clang on Windows does not define `__GNUC__`. The preprocessor falls to `#elif FMT_MSC_VERSION && !_HAS_EXCEPTIONS` with `_HAS_EXCEPTIONS 1` defined in vcruntime.h:104.
1 parent e9eaa27 commit ae23fe5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

include/fmt/base.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@
146146
// Use the provided definition.
147147
#elif defined(__GNUC__) && !defined(__EXCEPTIONS)
148148
# define FMT_USE_EXCEPTIONS 0
149+
#elif defined(__clang__) && !defined(__EXCEPTIONS)
150+
# define FMT_USE_EXCEPTIONS 0
149151
#elif FMT_MSC_VERSION && !_HAS_EXCEPTIONS
150152
# define FMT_USE_EXCEPTIONS 0
151153
#else

0 commit comments

Comments
 (0)