Bug 329588

Summary: RFE: please add option to put 'const' to *right* of type
Product: [Applications] kdevelop Reporter: Matthew Woehlke <mwoehlke.floss>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: NEEDSINFO WAITINGFORINFO    
Severity: wishlist CC: aristsakas
Priority: NOR    
Version First Reported In: 4.5.1   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Matthew Woehlke 2014-01-04 05:51:19 UTC
I am a (very) firm believer that the correct placement of 'const' is always on the right, e.g 'int const*', 'QString const&', and yes, even 'int const localVariable'.

Unfortunately, KDevelop's autocompletion doesn't honor this, making it less helpful than it could be.

Reproducible: Always

Steps to Reproduce:
1. Declare a function/method e.g. in a class header file.
2. Type the class name in the class source file in order to trigger auto-complete.
3. Accept auto-complete to fill in the skeleton of the new method.
Actual Results:  
Completion produces e.g.:

int Foo::bar(const QString& text)
{
}

Expected Results:  
Completion produces e.g.:

int Foo::bar(QString const& text)
{
}

Please add an option to cause completion to put 'const' to the right! (Bonus points for making it copy the 'const' placement for whatever it is completing so that it is automagic.)
Comment 1 aristsakas 2026-02-10 11:55:00 UTC
Thank you for the bug report. Unfortunately we were not able to get to it yet. Can we ask you to please check if this is still an issue with KDevelop 25.12.2.