remove some defensive code: LocalInstantiationScope::getInstantiationOf
and findInstantiationOf can never return null, even on invalid code.
llvm-svn: 125769
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index f58e744..0ad9f7c 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2168,8 +2168,7 @@
Decl *LocalInstantiationScope::getInstantiationOf(const Decl *D) {
llvm::PointerUnion<Decl *, DeclArgumentPack *> *Found= findInstantiationOf(D);
- if (!Found)
- return 0;
+ assert(Found);
if (Found->is<Decl *>())
return Found->get<Decl *>();
@@ -2202,8 +2201,7 @@
break;
}
- assert(D->isInvalidDecl() &&
- "declaration was not instantiated in this scope!");
+ assert(0 && "declaration was not instantiated in this scope!");
return 0;
}