Skip to content

Commit f92f775

Browse files
authored
[flang][NFC] Address reported "possible missing return" (#86523)
A function uses "if constexpr" to consider all possible types in a variant, but looks as if it can fall out without returning an expression. Add a final "else" with a crash to make things more clear and to protect against unlikely future extensions of the type. Fixes #86391.
1 parent bf4fc00 commit f92f775

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flang/lib/Semantics/tools.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,8 @@ static bool StopAtComponentPre(const Symbol &component) {
12871287
return !IsPointer(component);
12881288
} else if constexpr (componentKind == ComponentKind::PotentialAndPointer) {
12891289
return true;
1290+
} else {
1291+
DIE("unexpected ComponentKind");
12901292
}
12911293
}
12921294

0 commit comments

Comments
 (0)