[cfe-commits] [patch] PR12378 - conversion warnings on default args of function templates

David Blaikie dblaikie at gmail.com
Mon Apr 30 10:00:05 PDT 2012


Now with infinity percent more patch.

On Mon, Apr 30, 2012 at 9:40 AM, David Blaikie <dblaikie at gmail.com> wrote:
> Apparently we weren't providing any of the -Wconversion warnings on
> (dependent and non-dependent) default arguments in function templates.
> So this patch fixes that.
>
> Also, we weren't caching instantiations of default arguments - so we'd
> reinstantiate them several times (& that meant providing the
> conversion warnings multiple times, given where I added them in). So I
> fixed that so we don't reinstantiate them, instead using
> "setDefaultArg" which it looks like the code was setup to use but had
> just missed the last step.
>
> The last part was that we instantiate completely non-dependent
> arguments (where the parameter type and the default arg expression are
> non-dependent) - this caused us to warn on non-dependent default args
> for every instantiation (in addition to warning once for the
> uninstantiated template itself - we were already doing that before my
> patch). So I changed that to store those default args directly rather
> than as uninstantiated default arguments. To the best of my
> understanding this seems correct - if an expression isn't
> instantiation dependent then what does it mean to instantiate it? But
> perhaps I've missed some important detail there. No tests fail because
> of this, though.
>
> Thanks,
> - David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conv_default_args.diff
Type: application/octet-stream
Size: 2700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120430/ab627195/attachment.obj>


More information about the cfe-commits mailing list