Bug 294583 - Incorrect cpp signature update when I add const to method
Summary: Incorrect cpp signature update when I add const to method
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-21 20:38 UTC by Kulti
Modified: 2021-03-10 19:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
simple project to reproduce the bug (10.00 KB, application/x-gzip)
2012-02-22 05:27 UTC, Kulti
Details
Another sample project that demonstrates this bug (845 bytes, application/x-gzip)
2012-03-29 18:10 UTC, Claus Christmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kulti 2012-02-21 20:38:58 UTC
Version:           unspecified (using KDE 4.8.0) 
OS:                Linux

Application Version: 4.2.82

Reproducible: Always

Steps to Reproduce:
1. Add const to any method in header file, e.g. you have void RemoveBarrier(IBarrierPtr barrier); and want to do this method constant:
void RemoveBarrier(IBarrierPtr barrier) const;
2. Update definition signature(Alt+1)

Actual Results:  
void DungeonGraph::RemoveBarrier ( advangeon::IBarrierPtr barrier  const )

Expected Results:  
void DungeonGraph::RemoveBarrier ( advangeon::IBarrierPtr barrier ) const
Comment 1 Milian Wolff 2012-02-21 22:46:07 UTC
please add a small file/project that exhibits this behavior or give us some other clues on how to reproduce the issue
Comment 2 Kulti 2012-02-22 05:27:12 UTC
Created attachment 68997 [details]
simple project to reproduce the bug

Please, use attached test_294583 project to reproduce this bug.
1. Modify void doTest(int arg1, int arg2); to void doTest(int arg1, int arg2) const;
2. Alt+1

In result test_294583.cpp contains declaration.
Comment 3 Milian Wolff 2012-02-22 11:08:43 UTC
will try to do so later, thanks
Comment 4 Claus Christmann 2012-03-29 18:10:09 UTC
Created attachment 69996 [details]
Another sample project that demonstrates this bug

The compressed sample project shows the bug manifesting if the function definition (devclaration doesn't seem to matter) has a space before the closing parenthesis of the function parameters.
In order to test, open the project, open methods.h, add "const" to the methods and confirm the declaration update with Alt-1. Note how the "const" shows up on different locations in the declarations.


:~> kdevelop --version
Qt: 4.8.0
KDE Development Platform: 4.8.1 (4.8.1) "release 483"
KDevelop: 4.3.60
Comment 5 Justin Zobel 2021-03-09 22:48:50 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 6 Piotr Mierzwinski 2021-03-10 19:57:30 UTC
In the newest stable version of KDevelop (5.6.2) this seems works.
The issue is that this partially work and quickly stops work (in the same class/file).

Partially because, when we remove (newly added and adapted in definition) 'const' then happens nothing. And the worst is that since now feature adapting 'const' in definition stops work. Therefore if we will add const at end of declaration of method then happens nothing. Unless we  switch to another file and here it will work, but only till we remove 'const'.