D7799: Type Alias Template fix

Milian Wolff noreply at phabricator.kde.org
Wed Sep 13 13:25:02 UTC 2017


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  overall lgtm, I'd also like to see some unit test coverage please

INLINE COMMENTS

> builder.cpp:76
> +// TODO: investigate upstream implementation of CXCursor_TypeAliasTemplateDecl
> +CXCursor getEmbeddedTypeAlias(CXCursor aliasTemplate)
> +{

Please remove the `get` prefix. Just call it `embeddedTypeAlias` or use a `find` prefix

> builder.cpp:78
> +{
> +    CXCursor result;
> +    clang_visitChildren(aliasTemplate, [] (CXCursor cursor, CXCursor, CXClientData data) {

Just to ensure it's properly initialized, I'd write:

  auto result = clang_getNullCursor();

> builder.cpp:80
> +    clang_visitChildren(aliasTemplate, [] (CXCursor cursor, CXCursor, CXClientData data) {
> +        auto res = reinterpret_cast<CXCursor*>(data);
> +        if (clang_getCursorKind(cursor) == CXCursor_TypeAliasDecl) {

move this into the if branch below, it's only used there

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D7799

To: craigt, #kdevelop, mwolff, kfunk
Cc: apol, kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170913/25bd9af2/attachment-0001.html>


More information about the KDevelop-devel mailing list