[PATCH] Deprecated attribute on namespaces

Richard Smith richard at metafoo.co.uk
Fri Nov 14 14:21:16 PST 2014


On Fri, Nov 14, 2014 at 1:53 PM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> On Thu, Nov 13, 2014 at 9:13 PM, Richard Smith <richard at metafoo.co.uk>
> wrote:
> > On Sat, Nov 8, 2014 at 4:05 PM, Aaron Ballman <aaron at aaronballman.com>
> > wrote:
> >>
> >> C++1z now allows attributes on namespace and enumerators. We already
> >> supported deprecated enumerators, but we do not support namespaces.
> >> This patch addresses that.
> >>
> >> A few notes:
> >>
> >> It was decided that the deprecated attribute only applies to things
> >> with names (this makes reporting diagnostics a bit more sane), so this
> >> patch disallows deprecating an anonymous namespace.
> >>
> >> Since the declaration context can now cause deprecations, this
> >> requires updating some other test cases.
> >
> >
> > This wasn't the intention when this was discussed with EWG; the idea was
> > that using a deprecated name would result in a warning, but merely naming
> > something that's in a deprecated context would not.
>
> Ahh, thank you for the further clarification. I've attached a revised
> patch which I think captures the intent a bit better.
>

Thanks, LGTM

Can you also add a test for a namespace-alias (namespace M = N;) aliasing a
deprecated namespace? I'm not sure if we've already got a DiagnoseUseOfDecl
call in the right place for that case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141114/cfda4c42/attachment.html>


More information about the cfe-commits mailing list