Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings about PolygonX constructors #23981

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Aug 11, 2024

g++ 14.1.1 has a -Wtemplate-id-cdtor warning that complains constantly about the PolygonX constructors in geometry.h, which are incorrectly specified.

.../src/framework/draw/types/geometry.h:449:23: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  449 |     inline PolygonX<T>() = default;
      |                       ^
.../src/framework/draw/types/geometry.h:449:23: note: remove the ‘< >’
.../src/framework/draw/types/geometry.h:450:23: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  450 |     inline PolygonX<T>(const std::vector<PointX<T> >& v) : std::vector<PointX<T> >(v) {
      |                       ^
.../src/framework/draw/types/geometry.h:450:23: note: remove the ‘< >’
.../src/framework/draw/types/geometry.h:452:24: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  452 |     inline PolygonX<T>(size_t size) : std::vector<PointX<T> >(size) {
      |                        ^~~~~~
  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

g++ 14.1.1 complains _constantly_ about this, otherwise:

```text
.../src/framework/draw/types/geometry.h:449:23: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  449 |     inline PolygonX<T>() = default;
      |                       ^
.../src/framework/draw/types/geometry.h:449:23: note: remove the ‘< >’
.../src/framework/draw/types/geometry.h:450:23: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  450 |     inline PolygonX<T>(const std::vector<PointX<T> >& v) : std::vector<PointX<T> >(v) {
      |                       ^
.../src/framework/draw/types/geometry.h:450:23: note: remove the ‘< >’
.../src/framework/draw/types/geometry.h:452:24: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  452 |     inline PolygonX<T>(size_t size) : std::vector<PointX<T> >(size) {
      |                        ^~~~~~
```
@igorkorsukov igorkorsukov merged commit 8342161 into musescore:master Aug 11, 2024
11 checks passed
@ferdnyc ferdnyc deleted the no-tmpl-constructors branch August 11, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants