ZDoom / Raze

Build engine port backed by GZDoom tech. Currently supports Duke Nukem 3D, Blood, Shadow Warrior, Redneck Rampage and Powerslave/Exhumed.
664 stars 59 forks source link

[BUG] [General] A few little "C-isms" are causing GCC to panic #1083

Closed madame-rachelle closed 2 months ago

madame-rachelle commented 2 months ago

The following lines of code will make GCC cry foul the next time a backend sync with GZDoom is performed: https://github.com/ZDoom/Raze/blob/6dcb8c0f6e02eb271e74410274e08bc11f130e32/source/core/maptypes.h#L390 https://github.com/ZDoom/Raze/blob/6dcb8c0f6e02eb271e74410274e08bc11f130e32/source/core/maptypes.h#L395-L396

This is because the "ambiguous" constructor is "not allowed in anonymous aggregate", according to the compiler, when these lines are present: https://github.com/ZDoom/Raze/blob/23efdf95a1fe56d2a886ee0b262b48732d8919a4/source/common/objects/dobjgc.h#L217-L219

Here is the full error message: https://github.com/ZDoom/Raze/actions/runs/8728216207/job/23947470297#step:6:2123

Clang and MSVC both do not treat this as an error condition, but it might be possible that it's better to unwind this anyway to be used more safely in the future.

coelckers commented 2 months ago

I know this issue, that's why I removed the offending constructor from TObjPtr. Someone must have reinstated it through a PR instead of using existingMakeObjPtr which was added to get around this compiler bug. (GCC is clearly wrong here)