[Lldb-commits] [PATCH] D48303: Don't take the address of an xvalue when printing an expr result

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 18 16:35:19 PDT 2018


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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48303.151815.patch
Type: text/x-patch
Size: 660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180618/3424cdae/attachment.bin>


More information about the lldb-commits mailing list