[PATCH] D15174: [MSVC] Fix for http://llvm.org/PR25636: indexed accessor property not supported correctly.

John McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 8 10:26:46 PST 2015


rjmccall added a comment.

Thanks!


================
Comment at: lib/Sema/SemaPseudoObject.cpp:249
@@ -248,1 +248,3 @@
+    virtual bool useSetterResultAsExprResult(Expr *) const { return false; }
+    virtual bool captureSetValueAsResult() const { return true; }
   };
----------------
I think you just need one of these.  If useSetterResultAsExprResult() returns true, buildAssignmentOperation and buildIncDecOperation should try to capture the setter result; otherwise, they should try to capture the set value.  And it doesn't need to take an Expr* anymore.

Please add a comment explaining that; something like this:

  /// Should the result of an assignment be the formal result of the setter
  /// call or the value that was passed to the setter?
  ///
  /// Different pseudo-object language features use different language rules for this.
  /// The default is to use the set value.  Currently, this affects the behavior of simple
  /// assignments, compound assignments, and prefix increment and decrement.
  /// Postfix increment and decrement always use the getter result as the expression
  /// result.
  ///
  /// If this method returns false, and the set value isn't capturable for some
  /// reason, the result of the expression will be void.


http://reviews.llvm.org/D15174





More information about the cfe-commits mailing list