// be defined inside or outside a function etc).
bool isDefinedOutsideFunctionOrMethod() const {
if (getDeclContext())
- return !getDeclContext()->isFunctionOrMethod();
+ return !getDeclContext()->getLookupContext()->isFunctionOrMethod();
else
return true;
}
if (getKind() != Decl::Var)
return false;
if (const DeclContext *DC = getDeclContext())
- return DC->isFunctionOrMethod();
+ return DC->getLookupContext()->isFunctionOrMethod();
return false;
}
bool isFileVarDecl() const {
if (getKind() != Decl::Var)
return false;
- const DeclContext *Ctx = getDeclContext()->getLookupContext();
- if (isa<TranslationUnitDecl>(Ctx) || isa<NamespaceDecl>(Ctx) )
- return true;
+ if (const DeclContext *Ctx = getDeclContext()) {
+ Ctx = Ctx->getLookupContext();
+ if (isa<TranslationUnitDecl>(Ctx) || isa<NamespaceDecl>(Ctx) )
+ return true;
+ }
return false;
}
// in this case the class name or enumeration name is hidden.
if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
// We are pushing the name of a tag (enum or class).
- if (CurContext == TD->getDeclContext()) {
+ if (CurContext->getLookupContext()
+ == TD->getDeclContext()->getLookupContext()) {
// We're pushing the tag into the current context, which might
// require some reshuffling in the identifier resolver.
IdentifierResolver::iterator
bool VDIsTentative = isTentativeDefinition(VD);
bool VDIsIncompleteArray = VD->getType()->isIncompleteArrayType();
- // FIXME: I don't this will actually see all of the
+ // FIXME: I don't think this will actually see all of the
// redefinitions. Can't we check this property on-the-fly?
for (IdentifierResolver::iterator
I = IdResolver.begin(VD->getIdentifier(),