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:
parent
339552c5c3
commit
8ca24e7cf1
5 changed files with 30 additions and 1 deletions
|
|
@ -8434,6 +8434,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
|
|||
intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type);
|
||||
return newNode;
|
||||
}
|
||||
[[fallthrough]];
|
||||
case EOpConstructUVec3:
|
||||
case EOpConstructUVec4:
|
||||
case EOpConstructUint:
|
||||
|
|
@ -8455,6 +8456,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
|
|||
intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type);
|
||||
return newNode;
|
||||
}
|
||||
[[fallthrough]];
|
||||
case EOpConstructDVec2:
|
||||
case EOpConstructDVec3:
|
||||
case EOpConstructDVec4:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue