PATCH: fix assertion failure in assignment if an lvalues is constant but its type is not const-qualified

John Garvin jgarvin at apple.com
Fri May 15 15:20:06 PDT 2015


Ping!

John

> On May 13, 2015, at 5:04 PM, John Garvin <jgarvin at apple.com> wrote:
> 
> Say we have an expression E that is constant because it’s in a constant address space, but its type is not actually const-qualified. In CheckForModifiableLvalue in SemaExpr.cpp, if isModifiableLvalue returns MLV_ConstQualified, it calls isReferenceToConstCapture. It may be MLV_ConstQualified either because the type is actually “const” or because it’s in the OpenCL constant address space (see ExprClassification.cpp:608). Unfortunately, isReferenceToConstCapture asserts that the type must actually be “const”, which is not necessarily true. This patch changes the assertion to what I think is intended.
> 
> <constant.patch>_______________________________________________
> 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