https://bugs.kde.org/show_bug.cgi?id=358799

            Bug ID: 358799
           Summary: Function "Update declaration signature" breaks
                    declaration if inside there is default set parameter
           Product: kdevelop
           Version: 4.90.91
          Platform: Kubuntu Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Language Support: CPP (Clang-based)
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: piotr.mierzwin...@gmail.com

I tried to add parameter to function which one had default set last parameter.
I added parameter in definition.
I'm not sure if what I got is correct behaviour or not, but I expected
something else :/.
Simple example. I have defined one function

Declaration (header file):
    void foo( bool param=false );

Definition (cpp file)
void MyClass::foo( bool param )
{
    if (param)
        ;
}

Being in definition I add new parameter, for example "bool a" in header of
definition of function, so result would looked like this:  "void MyClass::foo(
bool param, bool a )"
"Update declaration signature" pops up and after pressing "Alt+1" I get
following modification in header file

    void foo( bool param = false, bool a = {} /* TODO */ );

This not what I expected.
I'm skipping here that formatting have not been met, despite I had defined one,
where "Add spaces around operators" wasn't set.

Reproducible: Always

Steps to Reproduce:
1. Having function with default setting parameter add new one in definition of
function
2. Made "Update declaration signature"


Actual Results:  
Together with new parameter is added such string: " = {} /* TODO */". Example:
void foo( bool param = false, bool a = {} /* TODO */ );

Expected Results:  
Default setting of parameter is removed and new parameter added. Example:
void foo( bool param, bool a );
and alternatively should be shown warning that "Current setting parameters
might be broke due to set default parameter. Do you want to continue?"

KDevelop, KDevplatform cloned at 30.12.2016 (at evening) from 5.0 branch.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to