[cfe-commits] Handle ExprWithCleanups when creating goto scopes

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Sep 11 22:16:21 PDT 2012


> The logic of this routine is fairly broken. It's trying to find an object construction (which is doesn't do correctly, even after your patch) and using that to blacklist all of the ill-formed patterns, rather than detecting based on the type and then white-listing the few exceptions.
>
> It should really check for the valid cases directly (scalar/vector types are okay, class types are okay when we're using the trivial default ctor and the dtor is trivial) and fail with a generic error if our type is not one of those valid cases. That way, the restricted form of the checking for CXXConstructExpr that's currently being used will suffice for detecting the "constructed with trivial constructor" case.

I think we still need to find object construction to decide if we need
an OutDiag or not. The attached patch improves the existing logic by
getting the CXXRecordDecl from the type, computing OutDiag early and
having a white list for InDiag as you suggested.

>         - Doug

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 4838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120912/1b24a1b6/attachment.obj>


More information about the cfe-commits mailing list