Remove implicit fallthrough (#3518)

This is intended so that downstream projects consuming glslang with FetchContent or similar means can use `-Wimplicit-fallthrough` without getting warning spam.

I've used my best judgement to determine whether the implicit fallthrough was desired, or was simply unreachable code.
`std::unreachable` is unavailable until C++23, but I saw places where `default: assert(0);` was used, so copied that.
There were a few places where some code might actually have been reachable and intended to return a value that represented an error, so someone should double check that kind of thing.
This commit is contained in:
Chris Djali 2024-02-19 22:45:45 +00:00 committed by GitHub
parent 339552c5c3
commit 8ca24e7cf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 1 deletions

View file

@ -8346,7 +8346,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s
case glslang::EOpSubgroupQuadAny:
builder.addExtension(spv::E_SPV_KHR_quad_control);
builder.addCapability(spv::CapabilityQuadControlKHR);
// pass through
[[fallthrough]];
case glslang::EOpSubgroupAll:
case glslang::EOpSubgroupAny:
case glslang::EOpSubgroupAllEqual: