[clang][bytecode] Fix crash in void functions returning non-void expr… (#176550)
The bytecode compiler was incorrectly emitting an
RVOPtr
opcode for void functions if the return expression had a non-void type
(e.g. from a conditional operator). This triggered an assertion in the
interpreter because void functions lack RVO metadata.
This patch updates
visitReturnStmt
to check the function’s return type and use
discard()
for the expression in void contexts, preventing erroneous RVO pathing.
Fixes #176536