> 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

Attachment: t.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to