https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104548
Bug ID: 104548 Summary: parser rejects alias template id of lambda in unevaluated-context and accepts when no alias is used Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nickhuang99 at hotmail dot com Target Milestone: --- I feel this issue is related with PR104537 and PR104358 Parser rejects following code with alias of template id: https://www.godbolt.org/z/eec3T5ebj template<typename T> using FunPtr=decltype(+[](T t)->T{return t+1;}); template<typename T> auto foo(T t, FunPtr<T> funPtr){ return funPtr(t); } void test(){ // parser rejects when using alias foo<int>(5, [](int t){return t+1;}); } <source>:14:21: error: invalid user-defined conversion from 'test()::<lambda(int)>' to 'int' [-fpermissive] 14 | foo<int>(5, [](int t){return t+1;}); | ^~~~~~~~~~~~~~~~~~~~~~ And accepts exact same code when NO alias is used: template<typename T> auto foo(T t, decltype(+[](T t)->T{return t+1;}) lam){ return lam(t); } void test(){ // parser accepts when no alias is used foo<int>(5, [](int t){return t+1;}); }