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

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

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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.
plugins/clang/codegen/adaptsignatureassistant.cpp
59

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!

plugins/clang/codegen/adaptsignatureassistant.cpp
59

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
plugins/clang/codegen/adaptsignatureassistant.cpp
49

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

53

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

mwolff added inline comments.Mar 14 2018, 8:02 AM
plugins/clang/codegen/adaptsignatureassistant.cpp
49
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 : shashwatdixit124@gmail.com

This revision was automatically updated to reflect the committed changes.