diff options
| author | Sam McCall <sam.mccall@gmail.com> | 2018-01-26 12:06:44 +0000 |
|---|---|---|
| committer | Sam McCall <sam.mccall@gmail.com> | 2018-01-26 12:06:44 +0000 |
| commit | fdc3207dc1bd6ba758d760e11a71bb78d7ccb6f9 (patch) | |
| tree | aca41a97c5014bf3fc929f8b701ef85993175056 | |
| parent | d2c67a75b0f0d0035e2715d45f108fc21dd41b9a (diff) | |
| download | bcm5719-llvm-fdc3207dc1bd6ba758d760e11a71bb78d7ccb6f9.tar.gz bcm5719-llvm-fdc3207dc1bd6ba758d760e11a71bb78d7ccb6f9.zip | |
[ASTImporter] avoid warnings: unused var, switch covered
llvm-svn: 323524
| -rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 13 | ||||
| -rw-r--r-- | clang/lib/AST/ExternalASTMerger.cpp | 1 |
2 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index aea044c8c49..89c58ceaee4 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2079,7 +2079,7 @@ bool ASTNodeImporter::ImportTemplateInformation(FunctionDecl *FromFD, switch (FromFD->getTemplatedKind()) { case FunctionDecl::TK_NonTemplate: case FunctionDecl::TK_FunctionTemplate: - break; + return false; case FunctionDecl::TK_MemberSpecialization: { auto *InstFD = cast_or_null<FunctionDecl>( @@ -2092,7 +2092,7 @@ bool ASTNodeImporter::ImportTemplateInformation(FunctionDecl *FromFD, FromFD->getMemberSpecializationInfo()->getPointOfInstantiation()); ToFD->setInstantiationOfMemberFunction(InstFD, TSK); ToFD->getMemberSpecializationInfo()->setPointOfInstantiation(POI); - break; + return false; } case FunctionDecl::TK_FunctionTemplateSpecialization: { @@ -2127,7 +2127,7 @@ bool ASTNodeImporter::ImportTemplateInformation(FunctionDecl *FromFD, ToFD->setFunctionTemplateSpecialization( Template, ToTAList, /* InsertPos= */ nullptr, TSK, FromTAArgsAsWritten ? &ToTAInfo : nullptr, POI); - break; + return false; } case FunctionDecl::TK_DependentFunctionTemplateSpecialization: { @@ -2153,13 +2153,10 @@ bool ASTNodeImporter::ImportTemplateInformation(FunctionDecl *FromFD, ToFD->setDependentTemplateSpecialization(Importer.getToContext(), TemplDecls, ToTAInfo); - break; + return false; } - default: - llvm_unreachable("All cases should be covered!"); } - - return false; + llvm_unreachable("All cases should be covered!"); } Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { diff --git a/clang/lib/AST/ExternalASTMerger.cpp b/clang/lib/AST/ExternalASTMerger.cpp index 91de8dbca05..edf1310d174 100644 --- a/clang/lib/AST/ExternalASTMerger.cpp +++ b/clang/lib/AST/ExternalASTMerger.cpp @@ -408,6 +408,7 @@ bool ExternalASTMerger::FindExternalVisibleDeclsByName(const DeclContext *DC, bool IsSpecImportFailed = importSpecializationsIfNeeded(LookupRes, Importer); assert(!IsSpecImportFailed); + (void)IsSpecImportFailed; Decls.push_back(ND); } SetExternalVisibleDeclsForName(DC, Name, Decls); |

