This is an archive of the discontinued LLVM Phabricator instance.

[Sema][Comments] Add support for TypeAliasTemplate
ClosedPublic

Authored by bruno on Aug 24 2016, 5:33 PM.

Details

Summary

Emit proper diagnostics when -Wdocumentation is used with constructs such as:

template<typename T>
using fn = int(T aaa, int ccc);

Previously clang wouldn't recognize the function and complain with
'comment that is not attached to a function declaration'.

Diff Detail

Event Timeline

bruno updated this revision to Diff 69187.Aug 24 2016, 5:33 PM
bruno retitled this revision from to [Sema][Comments] Add support for TypeAliasTemplate.
bruno updated this object.
bruno added a reviewer: gribozavr.
bruno added a subscriber: cfe-commits.
gribozavr accepted this revision.Aug 25 2016, 3:03 AM
gribozavr edited edge metadata.

LGTM with two more tests.

test/Sema/warn-documentation.cpp
433

For consistency with the rest of the file, could you use '11' instead of 'A'?

Could you also add these two tests:

/// <please-add-some-comment>
template<typename T>
using test_function_like_using10 = int (*)(T aaa, int ccc);

/// <please-add-some-comment>
template<typename T>
using test_function_like_using12 = foo::function_wrapper<int (T aaa, int ccc)> *;
This revision is now accepted and ready to land.Aug 25 2016, 3:03 AM
bruno closed this revision.Aug 25 2016, 10:18 AM

Applied your suggestions and committed r279754. Thanks!