================
Comment at: lib/Sema/Sema.cpp:752
@@ -751,3 +751,3 @@
         if (DiagD->isReferenced()) {
           Diag(DiagD->getLocation(), diag::warn_unneeded_internal_decl)
                 << /*variable*/1 << DiagD->getDeclName();
----------------
Rafael Ávila de Espíndola wrote:
> Don't you want to suppress this warning too? Consider:
> 
> // header
> static int baz;
> // main file
> template<typename T>
> int f() {
>   return baz;
> }
> 
> Can't you avoid putting these variables in UnusedFileScopedDecls in the first 
> place instead of filtering them out at the end of the TU?
> 
> Can't you avoid putting these variables in UnusedFileScopedDecls in the first 
> place instead of filtering them out at the end of the TU?

I wanted to keep the scope of this change relatively small, since the machinery 
that feeds into these diagnostics is pretty complicated and I don't have a good 
handle on all of it. I'm happy to broaden the scope if you think that's the 
right way to go.


http://llvm-reviews.chandlerc.com/D597
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to