[PATCH] Deprecated attribute on namespaces

Aaron Ballman aaron at aaronballman.com
Fri Nov 14 14:35:52 PST 2014


On Fri, Nov 14, 2014 at 5:21 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> 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.

Thanks, good idea on the namespace aliases; it was not handled
properly. I addressed it in r222054 (it was reasonably trivial, but if
I've mucked it up nonetheless, please let me know).

Thanks, again!

~Aaron



More information about the cfe-commits mailing list