Index: lib/AST/Comment.cpp =================================================================== --- lib/AST/Comment.cpp +++ lib/AST/Comment.cpp @@ -310,6 +310,20 @@ Kind = TypedefKind; TemplateKind = Template; TemplateParameters = TAT->getTemplateParameters(); + TypeAliasDecl *TAD = TAT->getTemplatedDecl(); + if (!TAD) + break; + + const TypeSourceInfo *TSI = TAD->getTypeSourceInfo(); + if (!TSI) + break; + TypeLoc TL = TSI->getTypeLoc().getUnqualifiedLoc(); + FunctionTypeLoc FTL; + if (getFunctionTypeLoc(TL, FTL)) { + Kind = FunctionKind; + ParamVars = FTL.getParams(); + ReturnType = FTL.getReturnLoc().getType(); + } break; } case Decl::Enum: Index: test/Sema/warn-documentation.cpp =================================================================== --- test/Sema/warn-documentation.cpp +++ test/Sema/warn-documentation.cpp @@ -416,6 +416,22 @@ /// \returns aaa. using test_function_like_using8 = foo::function_wrapper &&; +// expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}} +// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} +/// \param aaa Meow. +/// \param bbb Bbb. +/// \tparam U Uuu. +template +using test_function_like_using9 = int(T aaa, int ccc); + +// expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}} +// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} +/// \param aaa Meow. +/// \param bbb Bbb. +/// \tparam U Uuu. +template +using test_function_like_usingA = foo::function_wrapper; + using test_not_function_like_using1 = int (*)(int aaa); // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}