Skip to content
Snippets Groups Projects
Commit 7ea66742 authored by Vassil Vassilev's avatar Vassil Vassilev
Browse files

In cases of a = dep->Call(), we still need to visit the RHS, even if it was auto

candidate.
parent bfb1f032
No related branches found
No related tags found
No related merge requests found
...@@ -512,6 +512,9 @@ namespace cling { ...@@ -512,6 +512,9 @@ namespace cling {
} }
ASTNodeInfo EvaluateTSynthesizer::VisitBinaryOperator(BinaryOperator* Node) { ASTNodeInfo EvaluateTSynthesizer::VisitBinaryOperator(BinaryOperator* Node) {
ASTNodeInfo rhs = Visit(Node->getRHS());
ASTNodeInfo lhs;
if (const DeclRefExpr* DRE = dyn_cast<DeclRefExpr>(Node->getLHS())) { if (const DeclRefExpr* DRE = dyn_cast<DeclRefExpr>(Node->getLHS())) {
const Decl* D = DRE->getDecl(); const Decl* D = DRE->getDecl();
if (const AnnotateAttr* A = D->getAttr<AnnotateAttr>()) if (const AnnotateAttr* A = D->getAttr<AnnotateAttr>())
...@@ -519,16 +522,15 @@ namespace cling { ...@@ -519,16 +522,15 @@ namespace cling {
return ASTNodeInfo(Node, /*needs eval*/false); return ASTNodeInfo(Node, /*needs eval*/false);
} }
ASTNodeInfo rhs = Visit(Node->getRHS()); lhs = Visit(Node->getLHS());
ASTNodeInfo lhs = Visit(Node->getLHS());
assert((lhs.hasSingleNode() || rhs.hasSingleNode()) && assert((lhs.hasSingleNode() || rhs.hasSingleNode()) &&
"1:N replacements are not implemented yet!"); "1:N replacements are not implemented yet!");
// Try find out the type of the left-hand-side of the operator // Try find out the type of the left-hand-side of the operator
// and give the hint to the right-hand-side in order to replace the // and give the hint to the right-hand-side in order to replace the
// dependent symbol // dependent symbol
if (Node->isAssignmentOp() && if (Node->isAssignmentOp() && rhs.isForReplacement() &&
rhs.isForReplacement() &&
!lhs.isForReplacement()) { !lhs.isForReplacement()) {
if (Expr* LHSExpr = lhs.getAs<Expr>()) if (Expr* LHSExpr = lhs.getAs<Expr>())
if (!IsArtificiallyDependent(LHSExpr)) { if (!IsArtificiallyDependent(LHSExpr)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment