Properly handle (ignore) outer scope that are not namespace or TagDecl

git-svn-id: http://root.cern.ch/svn/root/trunk@47513 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Philippe Canal 2012-11-20 23:19:48 +00:00
parent a68395dc86
commit 65e877ce0f

View File

@ -410,9 +410,12 @@ namespace utils {
prefix = CreateNestedNameSpecifier(Ctx,
llvm::dyn_cast<NamespaceDecl>(outer));
} else {
assert(llvm::isa<TagDecl>(outer)&& "not in namespace of TagDecl");
prefix = CreateNestedNameSpecifier(Ctx,
llvm::dyn_cast<TagDecl>(outer));
// We should only create the nested name specifier
// if the outer scope is really a TagDecl.
// It could also be a CXXMethod for example.
TagDecl *tdecl = llvm::dyn_cast<TagDecl>(outer);
if (tdecl)
prefix = CreateNestedNameSpecifier(Ctx,tdecl);
}
}
}