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

Nick Lewycky nicholas at mxc.ca
Sun Oct 28 23:50:15 PDT 2012

This patch is the AST-changing bit broken out of the patch proposed here:
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.

Please review!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: using-directive-part-1.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121028/d00fdb47/attachment.bin>

More information about the cfe-commits mailing list