teemperor created this revision.

If we have an xvalue here, we will always hit the 
`err_typecheck_invalid_lvalue_addrof` error
in 'Sema::CheckAddressOfOperand' when trying to take the address of the result. 
This patch
uses the fallback code path where we store the result in a local variable 
instead when we hit
this case.

This fixes rdar://problem/40613277


https://reviews.llvm.org/D48303

Files:
  source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp


Index: source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
===================================================================
--- source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
+++ source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
@@ -292,8 +292,7 @@
   //
   //   - During dematerialization, $0 is ignored.
 
-  bool is_lvalue = (last_expr->getValueKind() == VK_LValue ||
-                    last_expr->getValueKind() == VK_XValue) &&
+  bool is_lvalue = (last_expr->getValueKind() == VK_LValue) &&
                    (last_expr->getObjectKind() == OK_Ordinary);
 
   QualType expr_qual_type = last_expr->getType();


Index: source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
===================================================================
--- source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
+++ source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
@@ -292,8 +292,7 @@
   //
   //   - During dematerialization, $0 is ignored.
 
-  bool is_lvalue = (last_expr->getValueKind() == VK_LValue ||
-                    last_expr->getValueKind() == VK_XValue) &&
+  bool is_lvalue = (last_expr->getValueKind() == VK_LValue) &&
                    (last_expr->getObjectKind() == OK_Ordinary);
 
   QualType expr_qual_type = last_expr->getType();
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to