[cfe-commits] patch: make using directives only occur in namespace or TU

John McCall rjmccall at apple.com
Tue Oct 30 18:47:55 PDT 2012


On Oct 28, 2012, at 11:50 PM, Nick Lewycky wrote:
> This patch is the AST-changing bit broken out of the patch proposed here:
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20121008/065734.html
> to change how using-directives are stored, and remove them from the land of NamedDecl.
> 
> This small patch changes what I think is the only place in the source that ever produces a UsingDirectiveDecl inside something that isn't a namespace or the TU: the implicit using-directive created for an anonymous namespace, when that anonymous namespace is inside a linkage spec. In other words:
> 
>  extern "C" {
>    namespace {
>      int i;
>    }
>  }
> 
> Previously we put the using-directive inside the linkage spec, with this patch we put it in the TU. As far as I know, this has no effect on anyone's compile, but changing the AST is more risky than the rest of the patch so I'm breaking it off into its own piece.

Abstractly that seems reasonable to me.

John.



More information about the cfe-commits mailing list