[cfe-commits] r141966 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Douglas Gregor dgregor at apple.com
Fri Oct 14 11:40:10 PDT 2011


On Oct 14, 2011, at 11:31 AM, Fariborz Jahanian wrote:

> Author: fjahanian
> Date: Fri Oct 14 13:31:36 2011
> New Revision: 141966
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=141966&view=rev
> Log:
> Make value kind based on the return type of the getter, not
> property type, for when getter may be a reference type.
> // rdar://10188258 revised.

Dare I ask for a test case?

	- Doug

> Modified:
>    cfe/trunk/lib/Sema/SemaExpr.cpp
> 
> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=141966&r1=141965&r2=141966&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Oct 14 13:31:36 2011
> @@ -7205,15 +7205,15 @@
>       VK = Expr::getValueKindForType(GetterMethod->getResultType());
>     }
>     else {
> +      // lvalue-ness of an explicit property is determined by
> +      // getter type.
>       Diag(PRE->getLocation(), diag::err_getter_not_found)
>             << PRE->getBase()->getType();
>     }
>   }
>   else {
> -    // lvalue-ness of an explicit property is determined by
> -    // property type.
> -    ObjCPropertyDecl *PDecl = PRE->getExplicitProperty();
> -    VK = Expr::getValueKindForType(PDecl->getType());
> +    QualType ResT = PRE->getGetterResultType();
> +     VK = Expr::getValueKindForType(ResT);
>   }
> 
>   E = ImplicitCastExpr::Create(Context, T, CK_GetObjCProperty,
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list