/// it is a declaration ("struct foo;").
bool IsDefinition : 1;
+ /// IsDefinedInDeclarator - True if this tag declaration is
+ /// syntactically defined in a declarator.
+ bool IsDefinedInDeclarator : 1;
+
/// TypedefForAnonDecl - If a TagDecl is anonymous and part of a typedef,
/// this points to the TypedefDecl. Used for mangling.
TypedefDecl *TypedefForAnonDecl;
assert((DK != Enum || TK == TK_enum) &&"EnumDecl not matched with TK_enum");
TagDeclKind = TK;
IsDefinition = false;
+ IsDefinedInDeclarator = false;
setPreviousDeclaration(PrevDecl);
}
return IsDefinition;
}
+ bool isDefinedInDeclarator() const {
+ return IsDefinedInDeclarator;
+ }
+ void setDefinedInDeclarator(bool isInDeclarator) {
+ IsDefinedInDeclarator = isInDeclarator;
+ }
+
/// \brief Whether this declaration declares a type that is
/// dependent, i.e., a type that somehow depends on template
/// parameters.
cast_or_null<TagDecl>(Reader.GetDecl(Record[Idx++])));
TD->setTagKind((TagDecl::TagKind)Record[Idx++]);
TD->setDefinition(Record[Idx++]);
+ TD->setDefinedInDeclarator(Record[Idx++]);
TD->setTypedefForAnonDecl(
cast_or_null<TypedefDecl>(Reader.GetDecl(Record[Idx++])));
TD->setRBraceLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
Writer.AddDeclRef(D->getPreviousDeclaration(), Record);
Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding
Record.push_back(D->isDefinition());
+ Record.push_back(D->isDefinedInDeclarator());
Writer.AddDeclRef(D->getTypedefForAnonDecl(), Record);
Writer.AddSourceLocation(D->getRBraceLoc(), Record);
Writer.AddSourceLocation(D->getTagKeywordLoc(), Record);
case UnqualifiedId::IK_TemplateId:
T = ConvertDeclSpecToType(*this, D, FnAttrsFromDeclSpec);
- if (!D.isInvalidType() && OwnedDecl && D.getDeclSpec().isTypeSpecOwned())
- *OwnedDecl = cast<TagDecl>((Decl *)D.getDeclSpec().getTypeRep());
+ if (!D.isInvalidType() && D.getDeclSpec().isTypeSpecOwned()) {
+ TagDecl* Owned = cast<TagDecl>((Decl *)D.getDeclSpec().getTypeRep());
+ Owned->setDefinedInDeclarator(Owned->isDefinition());
+ if (OwnedDecl) *OwnedDecl = Owned;
+ }
break;
case UnqualifiedId::IK_ConstructorName: