On Dec 12, 2008, at 12:25 AM, Douglas Gregor wrote: > Author: dgregor > Date: Fri Dec 12 02:25:50 2008 > New Revision: 60947 > > URL: http://llvm.org/viewvc/llvm-project?rev=60947&view=rev > Log: > Enable out-of-line definitions of C++ constructors and destructors > > = > = > = > = > = > = > = > = > ====================================================================== > --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) > +++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Dec 12 02:25:50 2008 > @@ -246,6 +246,24 @@ > } else if (LookupCtx) { > assert(getLangOptions().CPlusPlus && "No qualified name lookup > in C"); > > + switch (Name.getNameKind()) { > + case DeclarationName::CXXConstructorName: > + if (const CXXRecordDecl *Record = > dyn_cast<CXXRecordDecl>(LookupCtx)) > + return const_cast<CXXRecordDecl *>(Record)- > >getConstructors(); > + else > + return 0; > + > + case DeclarationName::CXXDestructorName: > + if (const CXXRecordDecl *Record = > dyn_cast<CXXRecordDecl>(LookupCtx)) > + return Record->getDestructor(); > + else > + return 0; > + > + default: > + // Normal name lookup. > + break; > + } > +
On further reflection, this is an ugly hack. We should be putting constructors and destructors directly into the DeclContext, so this new code can just go away. - Doug _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
