svn does not compile

svn rev 53524

Compilation fails:

CGObjCEtoile.cpp: In member function ‘virtual llvm::Function*::CGObjCEtoile::MethodPreamble(const std::string&, const std::string&, const std::string&, const llvm::Type*, const llvm::Type*, const llvm::Type**, unsigned int, bool, bool)’:
CGObjCEtoile.cpp:240: error: ambiguous overload for ‘operator[]’ in ‘AI[0]’
CGObjCEtoile.cpp:240: note: candidates are: operator[](llvm::Argument*, int)
/home/xzx/llvm/include/llvm/ADT/ilist.h:98: note: void llvm::ilist_iterator::operator[](unsigned int) [with NodeTy = llvm::Argument]
/home/xzx/llvm/include/llvm/ADT/ilist.h:99: note: void llvm::ilist_iterator::operator[](unsigned int) const [with NodeTy = llvm::Argument]
CGObjCEtoile.cpp:241: error: ambiguous overload for ‘operator[]’ in ‘AI[1]’
CGObjCEtoile.cpp:241: note: candidates are: operator[](llvm::Argument*, int)
/home/xzx/llvm/include/llvm/ADT/ilist.h:98: note: void llvm::ilist_iterator::operator[](unsigned int) [with NodeTy = llvm::Argument]
/home/xzx/llvm/include/llvm/ADT/ilist.h:99: note: void llvm::ilist_iterator::operator[](unsigned int) const [with NodeTy = llvm::Argument]
make[2]: *** [/home/xzx/llvm/tools/clang/lib/CodeGen/Debug/CGObjCEtoile.o] Error 1
make[2]: Leaving directory /home/xzx/llvm/tools/clang/lib/CodeGen' make[1]: *** [CodeGen/.makeall] Error 2 make[1]: Leaving directory /home/xzx/llvm/tools/clang/lib’
make: *** [all] Error 1

CGObjCEtoile.cpp is quite badly bit-rotted at this stage. I would recommend deleting it from svn, and I will submit a new version soon.

David

If the operator[] overloading in ilist.h is commented, it compiles. Where is the ilist::operator[] defined then?
I cannot find it in std::iterator.

If the operator[] overloading in ilist.h is commented, it compiles. Where is the ilist::operator[] defined then?

Sorry, where is the ilist_iterator::operator[] defined? My system is Fedora Linux 9.

Done, thanks David,

-Chris

Ah, nice... I thought it was a problem in my linux box but hadn't had the time to figure it out. Thanks, now clang compiles :slight_smile:

   - Filipe Cabecinhas

Let me answer my silly question:

If we don’t define operator[] as private functions, when operator[] is called on ilist_iterator, ilist_iterator::operator pointer() will be called. So it compiles. :slight_smile: