Do not register ObjCInterfaceDecls implicitly created by @class in the
current DeclContext. These "imaginary" declarations pose issues for clients searching DeclContext for actual declarations. Instead, register them for name lookup, and add the ObjCInterfaceDecl later to the DeclContext when we hit an actual @interface declaration. This also fixes a bug where the invariant that the Decls in a DeclContext are sorted in order of their appearance is no longer violated. What could happen is that an @class causes an ObjCInterfaceDecl to get added first to the DeclContext, then the ObjCClassDecl itself is added, and then later the SourceLocation of the ObjCInterfaceDecl is updated with the correct location (which is later in the file). This breaks an assumed invariant in ResolveLocation.cpp (and possibly other clients). llvm-svn: 89160
Loading
Please register or sign in to comment