Bug 372280 - Automatically generated virtual methods always use C++11 'override' keyword
Summary: Automatically generated virtual methods always use C++11 'override' keyword
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (other bugs)
Version First Reported In: 5.0.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2016-11-10 07:53 UTC by Jakub Schmidtke
Modified: 2018-12-03 11:01 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Schmidtke 2016-11-10 07:53:21 UTC
In 5.x version, generating method declaration using ctrl+space ALWAYS adds 'override' at the end. I don't use c++11 mode, so this does not compile. In the projects settings, in "language support" I have C++03 selected. This is NOT C++03!

Also, when generating declarations/definitions like that, new kdevelop ALWAYS adds full namespaces - including inside the class declaration, or in the implementation file even when "using namespace" is used.

Both of these are incredibly annoying!
Comment 1 Kevin Funk 2016-11-12 12:30:51 UTC
Yes, this needs to be made configurable.
Comment 2 Kevin Funk 2016-12-16 13:23:11 UTC
> Also, when generating declarations/definitions like that, new kdevelop ALWAYS adds full namespaces

Note: Reported on: https://bugs.kde.org/show_bug.cgi?id=373722
Comment 3 Amish Naidu 2018-12-03 10:51:09 UTC
Git commit 0636cfdd8a93617cbcf2efe2c9d74eab21a0b97b by Amish Naidu.
Committed on 03/12/2018 at 10:50.
Pushed by anaidu into branch 'master'.

Don't add 'override' specifier for non-modern project settings

Summary:
Override code completion will only add the override specifier if the parser
settings don't have either -std=c++03 or 98.

Supersedes: D4039

Test Plan: Run `test_codecompletion testOverrideExecute`

Reviewers: kfunk

Reviewed By: kfunk

Subscribers: kfunk, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D16773

M  +27   -1    plugins/clang/codecompletion/context.cpp
M  +65   -0    plugins/clang/tests/test_codecompletion.cpp
M  +2    -0    plugins/clang/tests/test_codecompletion.h

https://commits.kde.org/kdevelop/0636cfdd8a93617cbcf2efe2c9d74eab21a0b97b
Comment 4 Kevin Funk 2018-12-03 11:01:05 UTC
Git commit 27cca2f34f407d02212b15deb69d4506ce30d8f0 by Kevin Funk, on behalf of Amish Naidu.
Committed on 03/12/2018 at 10:57.
Pushed by kfunk into branch '5.3'.

Don't add 'override' specifier for non-modern project settings

Summary:
Override code completion will only add the override specifier if the parser
settings don't have either -std=c++03 or 98.

Supersedes: D4039

Test Plan: Run `test_codecompletion testOverrideExecute`

Reviewers: kfunk

Reviewed By: kfunk

Subscribers: kfunk, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D16773

(cherry picked from commit 0636cfdd8a93617cbcf2efe2c9d74eab21a0b97b)

M  +27   -1    plugins/clang/codecompletion/context.cpp
M  +65   -0    plugins/clang/tests/test_codecompletion.cpp
M  +2    -0    plugins/clang/tests/test_codecompletion.h

https://commits.kde.org/kdevelop/27cca2f34f407d02212b15deb69d4506ce30d8f0