public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "papadopo at shfj dot cea dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64
Date: Mon, 02 Aug 2004 13:21:00 -0000	[thread overview]
Message-ID: <20040802132147.16854.papadopo@shfj.cea.fr> (raw)

Hi,

The attached source makes use of the "long long" type which is defined by the
compiler. Unfortunately there's no specialization of stream input and output
operators for "long long":

$ cat > foo.cc
#include <iostream>
using namespace std;
int main() {
  long long i;
  cout << i << endl;
}
$ 
$ g++ foo.cc
foo.cc: In function `int main()':
foo.cc:5: error: ambiguous overload for 'operator<<' in 'std::cout << i'
/usr/local/include/c++/3.3.4/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>
/usr/local/include/c++/3.3.4/bits/ostream.tcc:74: 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>
/usr/local/include/c++/3.3.4/bits/ostream.tcc:86: 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>
/usr/local/include/c++/3.3.4/bits/ostream.tcc:122: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/bits/ostream.tcc:156: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/bits/ostream.tcc:98: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(bool) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/ostream:178: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(short int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/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>]
/usr/local/include/c++/3.3.4/ostream:193: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/ostream:204: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/bits/ostream.tcc:241: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(double) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/ostream:219: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(float) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/bits/ostream.tcc:265: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long double) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/include/c++/3.3.4/bits/ostream.tcc:289: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(const void*) [with _CharT = char, _Traits =
   std::char_traits<char>] <near match>
/usr/local/include/c++/3.3.4/bits/ostream.tcc:313: error:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(std::basic_streambuf<_CharT, _Traits>*) [with _CharT =
   char, _Traits = std::char_traits<char>] <near match>
/usr/local/include/c++/3.3.4/ostream:436: error:
   std::basic_ostream<_CharT, _Traits>&
   std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT =
   char, _Traits = std::char_traits<char>]
/usr/local/include/c++/3.3.4/bits/ostream.tcc:512: error:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, char) [with _Traits = std::char_traits<char>]
/usr/local/include/c++/3.3.4/ostream:447: error:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, signed char) [with _Traits = std::char_traits<char>]
/usr/local/include/c++/3.3.4/ostream:452: error:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, unsigned char) [with _Traits = std::char_traits<char>]
/usr/local/include/c++/3.3.4/bits/ostream.tcc:572: error:
   std::basic_ostream<_CharT, _Traits>&
   std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*) [with
   _CharT = char, _Traits = std::char_traits<char>] <near match>
/usr/local/include/c++/3.3.4/bits/ostream.tcc:616: error:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, const char*) [with _Traits = std::char_traits<char>] <near match>
/usr/local/include/c++/3.3.4/ostream:486: error:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, const signed char*) [with _Traits = std::char_traits<char>] <near
   match>
/usr/local/include/c++/3.3.4/ostream:491: error:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, const unsigned char*) [with _Traits = std::char_traits<char>]
   <near match>
$ 


That's because in header files <istream> and <ostream> the relevant functions
are protected by _GLIBCPP_USE_LONG_LONG:

	#ifdef _GLIBCPP_USE_LONG_LONG
	      __istream_type& 
 	     operator>>(long long& __n);
	
 	     __istream_type& 
 	     operator>>(unsigned long long& __n);
	#endif

and:

	#ifdef _GLIBCPP_USE_LONG_LONG
	      __ostream_type& 
	      operator<<(long long __n);
	
	      __ostream_type& 
	      operator<<(unsigned long long __n);
	#endif

Why is _GLIBCPP_USE_LONG_LONG not defined on Tru64? Type "long long" is legal
and distinct from "long". SHouldn't it be defined?

-- 
           Summary: streams missing "long long" specializations on Tru64
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: papadopo at shfj dot cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


             reply	other threads:[~2004-08-02 13:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-02 13:21 papadopo at shfj dot cea dot fr [this message]
2004-08-02 13:24 ` [Bug libstdc++/16854] " papadopo at shfj dot cea dot fr
2004-08-02 13:40 ` pcarlini at suse dot de
2004-08-02 13:55 ` papadopo at shfj dot cea dot fr
2004-08-02 14:07 ` pcarlini at suse dot de
2004-08-02 14:19 ` papadopo at shfj dot cea dot fr
2004-08-02 14:21 ` papadopo at shfj dot cea dot fr
2004-08-02 14:22 ` pcarlini at suse dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040802132147.16854.papadopo@shfj.cea.fr \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).