diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-11 21:25:24 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-11 21:25:24 +0000 |
commit | a90ee35a8e245feea5d60639a1d4aba84fa040d7 (patch) | |
tree | 8e55aa3ebf5a480212da47295f8351997e5c9126 /clang/lib/Sema/SemaDecl.cpp | |
parent | 46013d903f174b84edf9df1b444daa3f2c57358c (diff) | |
download | bcm5719-llvm-a90ee35a8e245feea5d60639a1d4aba84fa040d7.tar.gz bcm5719-llvm-a90ee35a8e245feea5d60639a1d4aba84fa040d7.zip |
PR19713: Don't warn on unused static inline functions, even if the 'inline' was
implied by 'constexpr'.
llvm-svn: 208511
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index b7c681f08e2..67c78ce904a 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1219,8 +1219,7 @@ bool Sema::ShouldWarnIfUnusedFileScopedDecl(const DeclaratorDecl *D) const { return false; } else { // 'static inline' functions are defined in headers; don't warn. - if (FD->isInlineSpecified() && - !isMainFileLoc(*this, FD->getLocation())) + if (FD->isInlined() && !isMainFileLoc(*this, FD->getLocation())) return false; } @@ -1245,6 +1244,8 @@ bool Sema::ShouldWarnIfUnusedFileScopedDecl(const DeclaratorDecl *D) const { } // Only warn for unused decls internal to the translation unit. + // FIXME: This seems like a bogus check; it suppresses -Wunused-function + // for inline functions defined in the main source file, for instance. return mightHaveNonExternalLinkage(D); } |