[PATCH] Deprecated attribute on namespaces

Aaron Ballman aaron at aaronballman.com
Sat Nov 8 16:05:53 PST 2014


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. Several of them now receive
two notes -- one for the declaration of a variable of enumerator type,
another for the use of the enumerator.

There are still improvements to be made for situations where a class
is effectively providing a namespace (static members, inner types,
etc).

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deprecated.patch
Type: application/octet-stream
Size: 11962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141108/4c937b7d/attachment.obj>


More information about the cfe-commits mailing list