You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/llvm-project/llvm/include/llvm/IR/DiagnosticInfo.h:584:10: error: cannot bind non-const lvalue reference of type 'llvm::OptimizationRemarkMissed&' to an rvalue of type 'llvm::OptimizationRemarkMissed'
The text was updated successfully, but these errors were encountered:
I encountered the same error when compiling with the latest gcc-15.0.0.
An OptimizationRemarkMissed instance is constructed as a temporary object using the return value. This temporary object is an rvalue, and the code attempts to use it continuously, especially when using the stream operator <<.
You can modify the code like this:
ORE.emit([&]() {
OptimizationRemarkMissed R(DEBUG_TYPE, "IncreaseCostInOtherContexts", Call);
R << "Not inlining. Cost of inlining '" << NV("Callee", Callee)
<< "' increases the cost of inlining '" << NV("Caller", Caller)
<< "' in other contexts";
return R;
});
This fixes compilation issues with GCC and C++23:
```
error: cannot bind non-const lvalue reference of type
'llvm::OptimizationRemarkMissed&' to an rvalue of type
'llvm::OptimizationRemarkMissed'
```
Closesllvm#105778
The text was updated successfully, but these errors were encountered: