Do not add return type to constructors declaration when editing definition in signature assistant.

Authored by shashwatdixit on Mar 13 2018, 4:47 PM.

Diff Detail

R32 KDevelop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
shashwatdixit requested review of this revision.Mar 13 2018, 4:47 PM
shashwatdixit created this revision.
shashwatdixit added a reviewer: KDevelop.
apol added a subscriber: apol.Mar 13 2018, 5:10 PM
apol added inline comments.

Only need to lock here, no? Or at least after the if.

brauch accepted this revision.Mar 13 2018, 5:13 PM
brauch added a subscriber: brauch.

Looks good to me, thanks!


Yeah but the macro is not a lock, just an assert. If you expect the function to be called with the lock, it IMO makes sense to put it on the top.

This revision is now accepted and ready to land.Mar 13 2018, 5:13 PM
mwolff added inline comments.Mar 13 2018, 9:53 PM

afaik you can simplify the below by reusing a function from DUChainUtils that gets you the declaration for a definition. always cast that at the start and then cast the return result


here and below: space after keywords (if (...)

mwolff added inline comments.Mar 14 2018, 8:02 AM
bool isConstructor(const Declaration *functionDecl)
    auto classFun = dynamic_cast<const ClassFunctionDeclaration*>(DUChainUtils::declarationForDefinition(functionDecl));
    return classFun && classFun->isConstructor();
mwolff accepted this revision.Mar 14 2018, 9:52 AM

cool, thanks

do you have commit rights to push this?

i don't have commit rights

Name : Shashwat Dixit
EMail :

This revision was automatically updated to reflect the committed changes.