================
@@ -7150,8 +7150,20 @@ bool Compiler<Emitter>::VisitVectorUnaryOperator(const
UnaryOperator *E) {
template <class Emitter>
bool Compiler<Emitter>::visitDeclRef(const ValueDecl *D, const Expr *E) {
- if (DiscardResult)
- return true;
+ if (DiscardResult) {
+ if (!(isa<VarDecl>(D) && D->getType()->isReferenceType()))
----------------
efriedma-quic wrote:
Is a VarDecl the only relevant kind of decl here?
Even if VarDecl is currently the only relevant kind of decl, this seems like a
bad way to structure the code; it's likely to get missed if a new kind of
relevant decl gets added.
https://github.com/llvm/llvm-project/pull/180923
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits