Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt/include\fmt/format-inl.h:1417:3: error: cannot use 'try' with exceptions disabled #4207

Closed
sergio-nsk opened this issue Oct 20, 2024 · 6 comments · Fixed by #4208
Closed

Comments

@sergio-nsk
Copy link
Contributor

sergio-nsk commented Oct 20, 2024

Getting this error while compiling with LLVM clang++.exe on Windows, the exceptions are disabled -fno-exceptions and -fms-compatibility is not used:

fmt/include\fmt/format-inl.h:1417:3: error: cannot use 'try' with exceptions disabled
 1417 |   FMT_TRY {
      |   ^
fmt/include\fmt\base.h:175:19: note: expanded from macro 'FMT_TRY'
  175 | #  define FMT_TRY try
      |  

Looks like relevant to #70 that does not seem to be properly/completely fixed.
The {fmt} version is 11.0.2.

@vitaut
Copy link
Contributor

vitaut commented Oct 20, 2024

There is no FMT_TRY at that location in the current version and it's likely been fixed. If not please provide a godbolt repro.

@vitaut vitaut closed this as completed Oct 20, 2024
@vitaut vitaut added the invalid label Oct 20, 2024
@sergio-nsk
Copy link
Contributor Author

sergio-nsk commented Oct 20, 2024

@vitaut This is a bad joke! The last version 11.0.2

FMT_TRY {
. The master
FMT_TRY {

@vitaut
Copy link
Contributor

vitaut commented Oct 20, 2024

As I wrote "it's likely been fixed" (it's unrelated to FMT_TRY being moved in case it wasn't clear) so please provide a repro on the current master.

@sergio-nsk
Copy link
Contributor Author

Bad kidding and unfriendly behavior again. "likely" must not be a reason of closing the issue until I confirm the fix.

@sergio-nsk
Copy link
Contributor Author

sergio-nsk commented Oct 20, 2024

The issue persists on 'master':

fmt/include\fmt/format-inl.h:137:3: error: cannot use 'throw' with exceptions disabled
  137 |   throw format_error(message);
      |   ^
fmt/include\fmt/format-inl.h:1426:3: error: cannot use 'try' with exceptions disabled
 1426 |   FMT_TRY {
      |   ^
fmt/include\fmt\base.h:155:19: note: expanded from macro 'FMT_TRY'
  155 | #  define FMT_TRY try
      |                   ^

@sergio-nsk
Copy link
Contributor Author

sergio-nsk commented Oct 20, 2024

If not please provide a godbolt repro.

I think @vitaut, the {fmt} author, should be aware of missing LLVM clang for Windows on Matt Godbolt' compiler explorer. The only option is MinGW clang that does not have {fmt} installed.

sergio-nsk added a commit to sergio-nsk/fmt that referenced this issue Oct 20, 2024
Fixes fmtlib#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.
sergio-nsk added a commit to sergio-nsk/fmt that referenced this issue Oct 21, 2024
Fixes fmtlib#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.
sergio-nsk added a commit to sergio-nsk/fmt that referenced this issue Oct 23, 2024
Fixes fmtlib#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.
@vitaut vitaut removed the invalid label Oct 23, 2024
@vitaut vitaut reopened this Oct 23, 2024
sergio-nsk added a commit to sergio-nsk/fmt that referenced this issue Oct 23, 2024
Fixes fmtlib#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.
vitaut pushed a commit that referenced this issue Oct 23, 2024
#4208)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants