Skip to content

Commit 1f14cb0

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 1f14cb0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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(__cpp_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)