Skip to content

avoid MSC warning C4702: unreachable code#4822

Merged
vitaut merged 1 commit into
fmtlib:mainfrom
torsten48:main
Jul 3, 2026
Merged

avoid MSC warning C4702: unreachable code#4822
vitaut merged 1 commit into
fmtlib:mainfrom
torsten48:main

Conversation

@torsten48

Copy link
Copy Markdown
Contributor

if FMT_CONSTEXPR is resolved to constexpr MSC warns about dead code after 'return' instruction. Explicitly using 'else' in these cases avoids the warning.

if FMT_CONSTEXPR is resolved to constexpr MSC warns about dead code
after 'return' instruction. Explicitly using 'else' in these cases
avoids the warning.

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general we don't care about level 4 MSVC warnings because of their very low quality but I think this particular change is relatively small scope so I'm OK merging it.

@vitaut vitaut merged commit b54093c into fmtlib:main Jul 3, 2026
46 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.

3 participants