ObjcImplementationDecl* IMPDecl =
new ObjcImplementationDecl(AtClassImplLoc, ClassName, SDecl);
+ if (!IDecl) {
+ // Legacy case of @implementation with no corresponding @interface.
+ // Build, chain & install the interface decl into the identifier.
+ IDecl = new ObjcInterfaceDecl(AtClassImplLoc, 0, ClassName);
+ IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
+ ClassName->setFETokenInfo(IDecl);
+
+ }
// Check that there is no duplicate implementation of this class.
bool err = false;
static bool classof(const ObjcCategoryDecl *D) { return true; }
};
-class ObjcImplementationDecl : public ScopedDecl {
+class ObjcImplementationDecl : public TypeDecl {
/// Implementation Class's super class.
ObjcInterfaceDecl *SuperClass;
public:
ObjcImplementationDecl(SourceLocation L, IdentifierInfo *Id,
ObjcInterfaceDecl* superDecl)
- : ScopedDecl(ObjcImplementation, L, Id, 0),
+ : TypeDecl(ObjcImplementation, L, Id, 0),
SuperClass(superDecl),
Ivars(0), NumIvars(-1),
InsMethods(0), NumInsMethods(-1), ClsMethods(0), NumClsMethods(-1) {}