[cfe-commits] [patch] Constructor initializers

Anders Johnsen skabet at gmail.com
Fri Aug 28 05:01:31 PDT 2009


On Fri, Aug 28, 2009 at 02:52, Eli Friedman <eli.friedman at gmail.com> wrote:

> On Thu, Aug 27, 2009 at 5:31 PM, Anders Johnsen<skabet at gmail.com> wrote:
> > Hi,
> > This is an attempt to implement instantiation of constructor
> initializers,
> > when the class is dependent.
>
> +    // Assign all the initializers to the new constructor.
> +    ActOnMemInitializers(DeclPtrTy::make(Function), PointOfInstantiation,
> +        (MemInitTy**)NewItems.data(), NewItems.size());
>
> The cast here (and in general, casting to an Object**) looks
> suspicious; it often leads to a strict-aliasing violation.


Yes, I've fixed this.

>
>   Stmt *Pattern = 0;
>   if (PatternDecl)
> -    Pattern = PatternDecl->getBody(PatternDecl);
> +    Pattern = PatternDecl->getBody((const FunctionDecl*&)PatternDecl);
>
>   if (!Pattern)
>     return;
>
> Similarly here.
>
also fixed (was not required)

>
> It would be easier to review this if the addition of RParenLoc were
> done in a separate patch.
>
Okay, I've split it.

>
> -Eli
>
Thank you for the review!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090828/e62cac79/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rparen.patch
Type: text/x-patch
Size: 4684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090828/e62cac79/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cons_init.patch
Type: text/x-patch
Size: 3168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090828/e62cac79/attachment-0001.bin>


More information about the cfe-commits mailing list