summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2017-04-11 16:05:23 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2017-04-11 16:05:23 +0000
commitc42bce809720790327691c48454a649db64ec737 (patch)
treeb39f52c87cca209ec8a3331425cee507ba0ceb12 /clang/lib/Sema/Sema.cpp
parent28611acef913496941eac195b6500a292cad49f4 (diff)
downloadbcm5719-llvm-c42bce809720790327691c48454a649db64ec737.tar.gz
bcm5719-llvm-c42bce809720790327691c48454a649db64ec737.zip
Revert temporarily D29877 "Warn about unused static file scope function template declarations."
We need to address cases (breaking libc++) such as template <class _Up> static int __test(...); template<typename _Tp> auto v = __test<_Tp>(0); llvm-svn: 299956
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index f943ab56507..294b56059b3 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -470,13 +470,6 @@ static bool ShouldRemoveFromUnused(Sema *SemaRef, const DeclaratorDecl *D) {
return true;
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- // If this is a function template and none of its specializations is used,
- // we should warn.
- if (FunctionTemplateDecl *Template = FD->getDescribedFunctionTemplate())
- for (const auto *Spec : Template->specializations())
- if (ShouldRemoveFromUnused(SemaRef, Spec))
- return true;
-
// UnusedFileScopedDecls stores the first declaration.
// The declaration may have become definition so check again.
const FunctionDecl *DeclToCheck;
@@ -500,13 +493,6 @@ static bool ShouldRemoveFromUnused(Sema *SemaRef, const DeclaratorDecl *D) {
VD->isUsableInConstantExpressions(SemaRef->Context))
return true;
- if (VarTemplateDecl *Template = VD->getDescribedVarTemplate())
- // If this is a variable template and none of its specializations is used,
- // we should warn.
- for (const auto *Spec : Template->specializations())
- if (ShouldRemoveFromUnused(SemaRef, Spec))
- return true;
-
// UnusedFileScopedDecls stores the first declaration.
// The declaration may have become definition so check again.
const VarDecl *DeclToCheck = VD->getDefinition();
OpenPOWER on IntegriCloud