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

-Wtemplate-id-cdtor compilation warnings with GCC 14 #91206

Closed
akien-mga opened this issue Apr 26, 2024 · 0 comments · Fixed by #91208
Closed

-Wtemplate-id-cdtor compilation warnings with GCC 14 #91206

akien-mga opened this issue Apr 26, 2024 · 0 comments · Fixed by #91208

Comments

@akien-mga
Copy link
Member

Tested versions

  • Reproducible in 4.3.dev (86bf835)
  • Likely affects earlier branches too so the fix should be cherry-picked

System information

Fedora Linux 40 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7600M XT (RADV NAVI33) () - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 Threads)

Issue description

I just upgraded to Fedora 40 which provides GCC 14.0.1 (RC version).

This version started raising a new type of warning:

warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]

We don't compile with C++20 yet (@Repiteo is working on supporting it in #89660), but it seems like GCC made this a warning for earlier versions of the standard anyway.

Here are the affected files from a Linux editor dev build:

./core/templates/safe_refcount.h:149:49: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  149 |         _ALWAYS_INLINE_ explicit SafeNumeric<T>(T p_value = static_cast<T>(0)) {
      |                                                 ^
./core/templates/safe_refcount.h:149:49: note: remove the '< >'
./core/templates/ring_buffer.h:214:22: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  214 |         RingBuffer<T>(int p_power = 0) {
      |                      ^
./core/templates/ring_buffer.h:214:22: note: remove the '< >'
./core/templates/ring_buffer.h:217:9: warning: template-id not allowed for destructor in C++20 [-Wtemplate-id-cdtor]
  217 |         ~RingBuffer<T>() {}
      |         ^
./core/templates/ring_buffer.h:217:9: note: remove the '< >'
thirdparty/clipper2/include/clipper2/clipper.core.h:183:22: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  183 |     explicit Point<T>(const Point<T2>& p) { Init(p.x, p.y); }
      |                      ^
thirdparty/clipper2/include/clipper2/clipper.core.h:183:22: note: remove the '< >'

Workaround for affected users:

  • Either build with werror=no
  • Or add cxxflags="-Wno-error=template-id-cdtor" to your scons command

Steps to reproduce

  • scons dev_build=yes dev_mode=yes

Minimal reproduction project (MRP)

n/a

@akien-mga akien-mga added this to the 4.3 milestone Apr 26, 2024
akien-mga added a commit to akien-mga/godot that referenced this issue Apr 29, 2024
akien-mga added a commit to akien-mga/godot that referenced this issue Apr 29, 2024
akien-mga added a commit that referenced this issue Apr 29, 2024
Fixes #91206.

(cherry picked from commit a8ff47b)
theromis pushed a commit to theromis/godot that referenced this issue Apr 29, 2024
dimitry- pushed a commit to AndroidWasm/godot that referenced this issue May 16, 2024
MewPurPur pushed a commit to MewPurPur/godot that referenced this issue Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants