This patch fixes:
llvm-project/flang/lib/Semantics/expression.cpp:405:12: error:
moving a local object in a return statement prevents copy elision
[-Werror,-Wpessimizing-move]
MaybeExpr ExpressionAnalyzer::Analyze(const parser::Designator &d) {
auto restorer{GetContextualMessages().SetLocation(d.source)};
if (auto substringInquiry{FixMisparsedSubstring(d)}) {
- return std::move(substringInquiry);
+ return substringInquiry;
}
// These checks have to be deferred to these "top level" data-refs where
// we can be sure that there are no following subscripts (yet).