Код: Выделить всё
struct SomeFoo;
SomeFoo myfuncReturningFoo() { return SomeFoo(); }
struct SomeFoo {};
int main()
{
SomeFoo ffoo = myfuncReturningFoo();
}
Теперь это:
Код: Выделить всё
struct SomeFoo;
template
SomeFoo myfuncReturningFoo() { return SomeFoo(); }
struct SomeFoo {};
int main()
{
SomeFoo ffoo = myfuncReturningFoo();
}
Что заставляет это происходить?
Я использую MSVC 17.9. 0, но в Godbolt это происходит с любой версией MSVC.
Подробнее здесь: https://stackoverflow.com/questions/784 ... ang-or-gcc