Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.

llvm-svn: 107473
This commit is contained in:
Argyrios Kyrtzidis 2010-07-02 11:55:20 +00:00
parent ee776bcb7a
commit dab33c5d33
2 changed files with 7 additions and 1 deletions

View File

@ -2544,6 +2544,9 @@ class InjectedClassNameType : public Type {
friend class ASTContext; // ASTContext creates these.
friend class TagDecl; // TagDecl mutilates the Decl
friend class PCHReader; // FIXME: ASTContext::getInjectedClassNameType is not
// currently suitable for PCH reading, too much
// interdependencies.
InjectedClassNameType(CXXRecordDecl *D, QualType TST)
: Type(InjectedClassName, QualType(), true),
Decl(D), InjectedType(TST) {

View File

@ -2197,7 +2197,10 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) {
case pch::TYPE_INJECTED_CLASS_NAME: {
CXXRecordDecl *D = cast<CXXRecordDecl>(GetDecl(Record[0]));
QualType TST = GetType(Record[1]); // probably derivable
return Context->getInjectedClassNameType(D, TST);
// FIXME: ASTContext::getInjectedClassNameType is not currently suitable
// for PCH reading, too much interdependencies.
return
QualType(new (*Context, TypeAlignment) InjectedClassNameType(D, TST), 0);
}
case pch::TYPE_TEMPLATE_TYPE_PARM: {