Skip to content

🐛 Clang on Windows will define _MSC_VER and do a redefined-#define#3060

Merged
horenmar merged 1 commit intocatchorg:develfrom
ThePhD:fix/clang-msvc-compiler-detection
Jan 19, 2026
Merged

🐛 Clang on Windows will define _MSC_VER and do a redefined-#define#3060
horenmar merged 1 commit intocatchorg:develfrom
ThePhD:fix/clang-msvc-compiler-detection

Conversation

@ThePhD
Copy link
Contributor

@ThePhD ThePhD commented Jan 16, 2026

This double-define triggers warnings (and warnings-as-errors) and, unfortunately, halts some of my builds and CI (like so). It's certainly not a big problem, but the fix is simple and it would be nice.

Description

When building on Windows with Clang or Clang-cl, the combination of __clang__ and _MSC_VER being defined at the same time trips up a multi-definition error in the configuration of catch's internals for warning suppression.

This PR fixes that by being specifically for MSVC OR Clang, but not both.

GitHub Issues

None (at least none I could find).

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.14%. Comparing base (024aec9) to head (a09b90c).
⚠️ Report is 1 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #3060   +/-   ##
=======================================
  Coverage   91.14%   91.14%           
=======================================
  Files         202      202           
  Lines        8831     8831           
=======================================
  Hits         8049     8049           
  Misses        782      782           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@horenmar
Copy link
Member

Thanks, but what I said on Discord about Clang-cl still applies.

@horenmar horenmar merged commit de7e863 into catchorg:devel Jan 19, 2026
88 checks passed
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 this pull request may close these issues.

2 participants