Skip to content

Compilation error for conditional noexcept on MSVC #62

Description

@davidhunter22

The line

class modifier<T, impl::void_t<decltype(++std::declval<underlying_type_t<T>&>())>>

in incrementable.hpp and maybe others gives the following error on MSVC up to at least Insiders [12106.202]

1>...\include\strong_type\incrementable.hpp(36,42): error C2065: 'T': undeclared identifier
1>...include\strong_type\incrementable.hpp(36,44): error C2760: syntax error: '>' was unexpected here; expected 'expression'
1>...\include\strong_type\incrementable.hpp(36,18): error C2057: expected constant expression

This is when compiling test_incrementable.cpp

This has been raised as an MSVC bug at https://developercommunity.visualstudio.com/t/Template-parameter-unrecognized-in-noexc/11133545?q=noexecpt
Note the code does build with clang and GCC

Oddly the test case on that issue uses a type called modifier so may have been reduced from code from this project
The issue have been marked as of Aug 17 2026 as Fixed Pending release

I am adding this issue so other people know that this is a known issue.
I will try to remember to come back and update this issue once the compiler fix has been released and the code shown to be compiling.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions