Демо-версия
Код: Выделить всё
struct C
{
C(int) = delete;
C(){};
};
decltype([b = C(3)](){ return 4;}()) var; //msvc OK but gcc and clang rejects
int main()
{
}
Код: Выделить всё
:13:18: error: use of deleted function 'C::C(int)'
13 | decltype([b = C(3)](){ return 4;}()) var ; //msvc OK but gcc and clang rejects
| ^
:4:3: note: declared here
4 | C(int) = delete;
| ^
:13:18: note: use '-fdiagnostics-all-candidates' to display considered candidates
13 | decltype([b = C(3)](){ return 4;}()) var ; //msvc OK but gcc and clang rejects
| ^
Код: Выделить всё
decltype([C(3)](){ return 4;}()) var2;Подробнее здесь: https://stackoverflow.com/questions/798 ... ng-rejects
Мобильная версия