[LLVMdev] AsmWriter.cpp:255: error: ambiguous overload for `std::basic_ostream<char,...

Chris Lattner sabre at nondot.org
Wed Jul 7 16:17:01 PDT 2004


On Wed, 7 Jul 2004, Henrik Bach wrote:

> Yes, Chris you're right. It seems that my << operator for int64_t is missing
> in my '/opt/gcc.3.3/include/c++/3.3/bits/ostream.tcc' file.
>
> Which ordinary version of GCC are you working with and how do your

We've used versions of G++ from 2.95 (which probably doesn't work with
LLVM now) through 3.4.  All of them had working operator<<'s.  My guess
is that the internix port is broken somehow.  I'm sorry, but I don't know
anything about the internix port.  You could ask on the
gcc-help at gcc.gnu.org mailing list, as they are probably the right ones to
ask.

-Chris

> >Here is an excerpt from the config.log for LLVM:
> >
> >configure:19451: checking for int64_t
> >configure:19476: gcc -c -g -O2  conftest.c >&5
> >configure:19479: $? = 0
> >configure:19482: test -s conftest.o
> >configure:19485: $? = 0
> >configure:19496: result: yes
> >configure:19511: checking for uint64_t
> >configure:19536: gcc -c -g -O2  conftest.c >&5
> >configure:19539: $? = 0
> >configure:19542: test -s conftest.o
> >configure:19545: $? = 0
> >configure:19556: result: yes
> >
> >All seems to be fine...
> >
> >/Henrik
> >
> >>
> >>Not sure if this will help, but something is terribly wrong, possibly with
> >>the definition of int64_t.  Note that the message from the compiler is not
> >>"can't find overload" but it is "ambiguous overload". It provides what it
> >>thinks is a close match, that being an operator<< that takes a pointer to
> >>a function returning basic_ostream<char>& and taken basic_ostream<char>&
> >>as an argument. Why would it attempt to match an int64_t with a function
> >>pointer?
> >>
> >>Reid.
> >>
> >>On Tue, 6 Jul 2004 17:48:17 -0500 (CDT)
> >>  Chris Lattner <sabre at nondot.org> wrote:
> >>>On Wed, 7 Jul 2004, Henrik Bach wrote:
> >>>>This tweak seems to work.
> >>>>
> >>>>As far as I can see, correct me if I'm wrong, it is the compiler, that
> >>>>can't
> >>>>figure out which std::basic_ostream to use. Why?
> >>>
> >>>What I'm saying is that it appears that your implementation of operator<<
> >>>is not functional or is missing.  You said that you are using GCC on
> >>>internix.  Is it possible that when you configured/built gcc that it
> >>>didn't find 64-bit integer support and disabled it or something?
> >>>
> >>>I really no nothing about internix so all I can do is speculate.  Sorry.
> >>>
> >>>-Chris
> >>>
> >>>
> >>>
> >>>> > > Compiling AsmWriter.cpp
> >>>> > > AsmWriter.cpp: In function `void WriteConstantInt(std::ostream&,
> >>>>const
> >>>> > >    llvm::Constant*, bool, std::map<const llvm::Type*, std::string,
> >>>> > >    std::less<const llvm::Type*>, std::allocator<std::pair<const
> >>>> >llvm::Type*
> >>>> > >    const, std::string> > >&, llvm::SlotCalculator*)':
> >>>> > > AsmWriter.cpp:255: error: ambiguous overload for
> >>>> >`std::basic_ostream<char,
> >>>> > >    std::char_traits<char> >& << int64_t' operator
> >>>> > > /opt/gcc.3.3/include/c++/3.3/bits/ostream.tcc:63: error: candidates
> >>>>are:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(std::basic_ostream<_CharT,
> >>>> > >    _Traits>&(*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT
> >>>>=
> >>>> >char,
> >>>> > >    _Traits = std::char_traits<char>] <near match>
> >>>> > > /opt/gcc.3.3/include/c++/3.3/bits/ostream.tcc:85: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(std::basic_ios<_CharT,
> >>>> > >    _Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT =
> >>>>char,
> >>>> > > _Traits
> >>>> > >    = std::char_traits<char>] <near match>
> >>>> > > /opt/gcc.3.3/include/c++/3.3/bits/ostream.tcc:107: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(std::ios_base&(*)(std::ios_base&)) [with
> >>>>_CharT
> >>>> >=
> >>>> > > char,
> >>>> > >    _Traits = std::char_traits<char>] <near match>
> >>>> > > /opt/gcc.3.3/include/c++/3.3/bits/ostream.tcc:179: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(long int) [with _CharT = char, _Traits =
> >>>> > >    std::char_traits<char>]
> >>>> > > /opt/gcc.3.3/include/c++/3.3/bits/ostream.tcc:216: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(long unsigned int) [with _CharT = char,
> >>>>_Traits
> >>>> >=
> >>>> > >    std::char_traits<char>]
> >>>> > > /opt/gcc.3.3/include/c++/3.3/bits/ostream.tcc:154: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(bool) [with _CharT = char, _Traits =
> >>>> > >    std::char_traits<char>]
> >>>> > > /opt/gcc.3.3/include/c++/3.3/ostream:178: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(short int) [with _CharT = char, _Traits =
> >>>> > >    std::char_traits<char>]
> >>>> > > /opt/gcc.3.3/include/c++/3.3/ostream:189: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(short unsigned int) [with _CharT = char,
> >>>>_Traits
> >>>> >=
> >>>> > >    std::char_traits<char>]
> >>>> > > /opt/gcc.3.3/include/c++/3.3/ostream:193: error:
> >>>> > >    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> > >    _Traits>::operator<<(int) [with _CharT = char, _Traits =
> >>>> > >    std::char_traits<char>]
> >>>> > >
> >>>> > > ... and so on.
> >>>> > >
> >>>> > >
> >>>> > > /Henrik
> >>>> > >
> >>>> > > _________________________________________________________________
> >>>> > > F? alle de nye og sjove ikoner med MSN Messenger
> >>>> >http://www.msn.dk/messenger
> >>>> > >
> >>>> > > _______________________________________________
> >>>> > > LLVM Developers mailing list
> >>>> > > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >>>> > > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> >>>> > >
> >>>> >
> >>>> >-Chris
> >>>> >
> >>>> >--
> >>>> >http://llvm.cs.uiuc.edu/
> >>>> >http://www.nondot.org/~sabre/Projects/
> >>>> >
> >>>> >
> >>>> >_______________________________________________
> >>>> >LLVM Developers mailing list
> >>>> >LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >>>> >http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> >>>>
> >>>>_________________________________________________________________
> >>>>F? alle de nye og sjove ikoner med MSN Messenger
> >>>>http://www.msn.dk/messenger
> >>>>
> >>>>_______________________________________________
> >>>>LLVM Developers mailing list
> >>>>LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >>>>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> >>>>
> >>>
> >>>-Chris
> >>>
> >>>--
> >>>http://llvm.cs.uiuc.edu/
> >>>http://www.nondot.org/~sabre/Projects/
> >>>
> >>>
> >>>_______________________________________________
> >>>LLVM Developers mailing list
> >>>LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >>>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> >>
> >>_______________________________________________
> >>LLVM Developers mailing list
> >>LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
> >_________________________________________________________________
> >Få alle de nye og sjove ikoner med MSN Messenger
> >http://www.msn.dk/messenger
> >
> >_______________________________________________
> >LLVM Developers mailing list
> >LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> _________________________________________________________________
> Få alle de nye og sjove ikoner med MSN Messenger http://www.msn.dk/messenger
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/





More information about the llvm-dev mailing list