aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index a17e9d0cda..c20b5ff068 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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;
}