[PATCH] Fix PR15558

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Apr 9 14:04:21 PDT 2013



================
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();
----------------
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?



http://llvm-reviews.chandlerc.com/D597



More information about the cfe-commits mailing list