While working on my own array types, I encountered this issue, where one of my unit tests passes for Clang, but fails on MSVC with the following messages:
error C7595: 'UnitTest': call to immediate function is not a constant expression
note: a non-constant (sub-)expression was encountered
note: the call stack of the evaluation (the oldest call first) is
note: while evaluating function 'void UnitTest(void)'
https://godbolt.org/z/KrbWMe8sM
Removing the std::move
from line 54 makes it work correctly in this whittled-down example, but is not acceptable for the full version where I want to distinguish between moving and copying.
Is this a bug with MSVC, or is Clang incorrect in accepting this code?