google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.37k stars 1.84k forks source link

1.51.4 fails to compile: error: loop variable '[target, setId]' creates a copy from type 'const value_type' (aka 'const pair<const unsigned int, unsigned int>') #7762

Closed yurivict closed 2 months ago

yurivict commented 2 months ago

⚠️ Issues not using this template will be systematically closed.

Describe the bug

/wrkdirs/usr/ports/graphics/filament/work/filament-1.51.4/filament/backend/src/vulkan/spirv/VulkanSpirvUtils.cpp:186:21: error: loop variable '[target, setId]' creates a copy from type 'const value_type' (aka 'const pair<const unsigned int, unsigned int>') [-Werror,-Wrange-loop-construct]
    for (auto const [target, setId]: targetToSet) {
                    ^
/wrkdirs/usr/ports/graphics/filament/work/filament-1.51.4/filament/backend/src/vulkan/spirv/VulkanSpirvUtils.cpp:186:10: note: use reference type 'const value_type &' (aka 'const pair<const unsigned int, unsigned int> &') to prevent copying
    for (auto const [target, setId]: targetToSet) {
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                    &
1 error generated.

To Reproduce Regular build.

Desktop (please complete the following information):