[PATCH] Allow "redefinition" of typedef of anon tag from unimported submodule

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 13 17:32:50 PST 2015


> On Nov 13, 2015, at 4:20 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> 
> On Fri, Nov 13, 2015 at 4:03 PM, Ben Langmuir via cfe-commits <cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>> wrote:
> This time sending to the right list address.
> 
> Likewise =)
> 
> > On Nov 13, 2015, at 4:00 PM, Ben Langmuir <blangmuir at apple.com <mailto:blangmuir at apple.com>> wrote:
> >
> > Hey Richard,
> >
> > After your commit r233345 we started diagnosing “redefinition” errors for typedefs of anonymous tags that are *not visible* in case like this:
> >
> > module that isn’t imported:
> >   typedef struct { … } Foo_t;
> > source file:
> >   typedef struct { … } Foo_t;
> >
> > I think the only change needed is to not consider these anonymous tags to be the same entity unless we’re in C++.  Patch attached.
> 
> Looks fine. Do we also miscompute the linkage for these things in C (where types don't really have linkage), or is this just a problem because we bail out before we hit the isExternallyVisible check?


Ack, my copy of clang was a couple of days old and I guess you’ve been working in this area!  My patch is no longer sufficient...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151113/ff718ae0/attachment.html>


More information about the cfe-commits mailing list