diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index a17e9d0cdaf..c20b5ff068a 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1219,7 +1219,10 @@ bool Sema::ShouldWarnIfUnusedFileScopedDecl(const DeclaratorDecl *D) const { return false; } else { // 'static inline' functions are used in headers; don't warn. - if (FD->getStorageClass() == SC_Static && + // Make sure we get the storage class from the canonical declaration, + // since otherwise we will get spurious warnings on specialized + // static template functions. + if (FD->getCanonicalDecl()->getStorageClass() == SC_Static && FD->isInlineSpecified()) return false; } |