[PATCH] fix parentheses location in a CXXConstructExpr

Olivier Goffart via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 29 03:27:07 PDT 2015


Hi,

Please review the attached patch.

In Sema::BuildCXXFunctionalCastExpr, if the class has a destructor, the 
Op.SrcExpr might be a CXXBindTemporaryExpr which we need to unwrap.

In the testcase, the first new CHECK worked (because A does not have a 
destructor),  but the second CHECK failed (did not include the last 
parenthese) because D has a destructor.

I used dyn_cast_or_null just to be safe, becasue i don't know if it is 
possible for the BindExpr->getSubExpr() to be null.

Thanks
-- 
Olivier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-the-perentheses-location-when-the-constructor-is.patch
Type: text/x-patch
Size: 2094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150829/31f5ae01/attachment.bin>


More information about the cfe-commits mailing list