https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85493
Bug ID: 85493 Summary: decltype can use deleted constructor in template function Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: ihorelo at mail dot ru Target Milestone: --- decltype can use deleted constructor in template function struct no_def { no_def() = delete; }; template<typename T> void test() { decltype(no_def()) a{}; // error in Clang and MSVC, no error in GCC a = a; // get rid of warning } int main() { test<int>(); } Please check https://stackoverflow.com/questions/49965849/decltype-with-deleted-constructor-is-possible-in-template-function