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

John Garvin jgarvin at apple.com
Wed May 13 17:04:31 PDT 2015


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: constant.patch
Type: application/octet-stream
Size: 1170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150513/41804e15/attachment.obj>


More information about the cfe-commits mailing list