<p dir="ltr">LGTM</p>
<div class="gmail_quote">On 24 Feb 2015 11:51, "Reid Kleckner" <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi rsmith,<br>
<br>
Fixes PR22671.<br>
<br>
<a href="http://reviews.llvm.org/D7863" target="_blank">http://reviews.llvm.org/D7863</a><br>
<br>
Files:<br>
  lib/AST/ExprClassification.cpp<br>
  lib/Sema/SemaExpr.cpp<br>
  test/SemaCXX/MicrosoftExtensions.cpp<br>
<br>
Index: lib/AST/ExprClassification.cpp<br>
===================================================================<br>
--- lib/AST/ExprClassification.cpp<br>
+++ lib/AST/ExprClassification.cpp<br>
@@ -418,9 +418,10 @@<br>
     islvalue = NTTParm->getType()->isReferenceType();<br>
   else<br>
     islvalue = isa<VarDecl>(D) || isa<FieldDecl>(D) ||<br>
-         isa<IndirectFieldDecl>(D) ||<br>
-      (Ctx.getLangOpts().CPlusPlus &&<br>
-        (isa<FunctionDecl>(D) || isa<FunctionTemplateDecl>(D)));<br>
+               isa<IndirectFieldDecl>(D) ||<br>
+               (Ctx.getLangOpts().CPlusPlus &&<br>
+                (isa<FunctionDecl>(D) || isa<MSPropertyDecl>(D) ||<br>
+                 isa<FunctionTemplateDecl>(D)));<br>
<br>
   return islvalue ? Cl::CL_LValue : Cl::CL_PRValue;<br>
 }<br>
Index: lib/Sema/SemaExpr.cpp<br>
===================================================================<br>
--- lib/Sema/SemaExpr.cpp<br>
+++ lib/Sema/SemaExpr.cpp<br>
@@ -9352,6 +9352,8 @@<br>
           !getLangOpts().CPlusPlus) {<br>
         AddressOfError = AO_Register_Variable;<br>
       }<br>
+    } else if (isa<MSPropertyDecl>(dcl)) {<br>
+      AddressOfError = AO_Property_Expansion;<br>
     } else if (isa<FunctionTemplateDecl>(dcl)) {<br>
       return Context.OverloadTy;<br>
     } else if (isa<FieldDecl>(dcl) || isa<IndirectFieldDecl>(dcl)) {<br>
Index: test/SemaCXX/MicrosoftExtensions.cpp<br>
===================================================================<br>
--- test/SemaCXX/MicrosoftExtensions.cpp<br>
+++ test/SemaCXX/MicrosoftExtensions.cpp<br>
@@ -344,6 +344,18 @@<br>
   __declspec(property(get=GetV)) int : 10; // expected-error {{anonymous property is not supported}}<br>
 };<br>
<br>
+struct MSPropertyClass {<br>
+  int get() { return 42; }<br>
+  int __declspec(property(get = get)) n;<br>
+};<br>
+<br>
+int *f(MSPropertyClass &x) {<br>
+  return &x.n; // expected-error {{address of property expression requested}}<br>
+}<br>
+int MSPropertyClass::*g() {<br>
+  return &MSPropertyClass::n; // expected-error {{address of property expression requested}}<br>
+}<br>
+<br>
 namespace rdar14250378 {<br>
   class Bar {};<br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</blockquote></div>