Open Bug 1908723 Opened 4 months ago Updated 4 months ago

glsl-optimizer's unreachable() macro conflicts with C++23's std::unreachable() definition

Categories

(Core :: Graphics: WebRender, task, P5)

task

Tracking

()

People

(Reporter: cpeterson, Unassigned)

References

(Blocks 1 open bug)

Details

glsl-optimizer's macros.h #defines a macro called unreachable() whose name conflicts with C++23's new std::unreachable() function declaration in the std library header.

https://en.cppreference.com/w/cpp/utility/unreachable

warning: ~/.mozbuild/MacOSX14.2.sdk/usr/include/c++/v1/__utility/unreachable.h:28:48: error: expected unqualified-id
warning: 28 | [[noreturn]] _LIBCPP_HIDE_FROM_ABI inline void unreachable() { __libcpp_unreachable(); }
warning: third_party/rust/glslopt/glsl-optimizer/src/util/macros.h:76:29: note: expanded from macro 'unreachable'
warning: 76 | #define unreachable(str)

I submitted a fix to glsl-optimizer upstream: https://github.com/jamienicol/glsl-optimizer/pull/10

That fix needs to be merged, vendored into the glslopt bindings (https://github.com/jamienicol/glslopt-rs), and then vendored into mozilla-central.

This C++23 compat issue is a low priority because mozilla-central doesn't even compile as C++20 yet (meta bug 1768116).

You need to log in before you can comment on or make changes to this bug.