int main()
{
struct STR
{
STR() {}
STR(const STR&) = delete;
};
bool b = true;
auto&& a0 = b ? STR{} : STR{};
}
The following code successfully compiles on the latest versions of gcc and clang but fails on MSVC:
error C2280: 'main::STR::STR(const main::STR &)': attempting to reference a deleted function
note: see declaration of 'main::STR::STR'
note: 'main::STR::STR(const main::STR &)': function was explicitly deleted
Can it be considered as an MSVC bug?