Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-155

[Sun C++ 5.7] overloading ambiguity on std::operator<<(ostream&, const string&)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Won't Fix
    • 4.1.3
    • 4.2.0
    • 27. Input/Output
    • None
    • CC: Sun C++ 5.7 Patch 117830-04 2005/09/14

    Description

      The examples below fail to compile with Sun C++ 5.7 on Solaris 9. The output of CC -V is:
      CC: Sun C++ 5.7 Patch 117830-04 2005/09/14

      make: Entering directory `/build/sebor/sunpro-5.7-8d/examples'
      CC -c -D_RWSTD_USE_CONFIG -I/build/sebor/sunpro-5.7-8d/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -library=%none -O +w /build/sebor/dev/stdlib/examples/tutorial/alg1.cpp
      "/build/sebor/dev/stdlib/include/sstream", line 353: Warning: std::ostringstream::rdbuf hides the function std::ios::rdbuf(std::streambuf *).
      "/build/sebor/dev/stdlib/examples/tutorial/alg1.cpp", line 148: Where: While specializing "std::ostringstream ".
      "/build/sebor/dev/stdlib/examples/tutorial/alg1.cpp", line 148: Where: Specialized in non-template code.
      "/build/sebor/dev/stdlib/include/rw/_streamiter.h", line 148: Error: Overloading ambiguity between "std::operator<<<char, char, std::char_traits<char>, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)" and "std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)".
      "/build/sebor/dev/stdlib/include/rw/_algobase.h", line 88: Where: While instantiating "std::ostream_iterator<std::string, char, std::char_traits<char>>::operator=(const std::string &)".
      "/build/sebor/dev/stdlib/include/rw/_algobase.h", line 88: Where: Instantiated from non-template code.
      1 Error(s) and 1 Warning(s) detected.
      make: *** [alg1.o] Error 1
      CC -c -D_RWSTD_USE_CONFIG -I/build/sebor/sunpro-5.7-8d/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -library=%none -O +w /build/sebor/dev/stdlib/examples/manual/bitset.cpp
      "/build/sebor/dev/stdlib/include/bitset", line 684: Error: Overloading ambiguity between "std::operator<<<char, char, std::char_traits<char>, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)" and "std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)".
      1 Error(s) detected.
      make: *** [bitset.o] Error 1
      CC -c -D_RWSTD_USE_CONFIG -I/build/sebor/sunpro-5.7-8d/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -library=%none -O +w /build/sebor/dev/stdlib/examples/manual/complex.cpp
      "/build/sebor/dev/stdlib/include/sstream", line 353: Warning: std::ostringstream::rdbuf hides the function std::ios::rdbuf(std::streambuf *).
      "/build/sebor/dev/stdlib/include/complex", line 930: Where: While specializing "std::ostringstream ".
      "/build/sebor/dev/stdlib/include/complex", line 930: Where: Specialized in non-template code.
      "/build/sebor/dev/stdlib/include/complex", line 935: Error: Overloading ambiguity between "std::operator<<<char, char, std::char_traits<char>, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)" and "std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)".
      1 Error(s) and 1 Warning(s) detected.
      make: *** [complex.o] Error 1
      CC -c -D_RWSTD_USE_CONFIG -I/build/sebor/sunpro-5.7-8d/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -library=%none -O +w /build/sebor/dev/stdlib/examples/tutorial/complx.cpp
      "/build/sebor/dev/stdlib/include/sstream", line 353: Warning: std::ostringstream::rdbuf hides the function std::ios::rdbuf(std::streambuf *).
      "/build/sebor/dev/stdlib/include/complex", line 930: Where: While specializing "std::ostringstream ".
      "/build/sebor/dev/stdlib/include/complex", line 930: Where: Specialized in non-template code.
      "/build/sebor/dev/stdlib/include/complex", line 935: Error: Overloading ambiguity between "std::operator<<<char, char, std::char_traits<char>, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)" and "std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)".
      1 Error(s) and 1 Warning(s) detected.
      make: *** [complx.o] Error 1
      CC -c -D_RWSTD_USE_CONFIG -I/build/sebor/sunpro-5.7-8d/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -library=%none -O +w /build/sebor/dev/stdlib/examples/manual/locale.cpp
      "/build/sebor/dev/stdlib/include/rw/_streamiter.h", line 148: Error: Overloading ambiguity between "std::operator<<<char, char, std::char_traits<char>, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)" and "std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)".
      "/build/sebor/dev/stdlib/include/rw/_algobase.h", line 88: Where: While instantiating "std::ostream_iterator<std::string, char, std::char_traits<char>>::operator=(const std::string &)".
      "/build/sebor/dev/stdlib/include/rw/_algobase.h", line 88: Where: Instantiated from non-template code.
      1 Error(s) detected.
      make: *** [locale.o] Error 1
      CC -c -D_RWSTD_USE_CONFIG -I/build/sebor/sunpro-5.7-8d/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -library=%none -O +w /build/sebor/dev/stdlib/examples/tutorial/spell.cpp
      "/build/sebor/dev/stdlib/include/fstream", line 444: Warning: std::ifstream::rdbuf hides the function std::ios::rdbuf(std::streambuf *).
      "/build/sebor/dev/stdlib/examples/tutorial/spell.cpp", line 67: Where: While specializing "std::ifstream ".
      "/build/sebor/dev/stdlib/examples/tutorial/spell.cpp", line 67: Where: Specialized in non-template code.
      "/build/sebor/dev/stdlib/include/rw/_streamiter.h", line 148: Error: Overloading ambiguity between "std::operator<<<char, char, std::char_traits<char>, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)" and "std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::ostream &, const std::string &)".
      "/build/sebor/dev/stdlib/include/rw/_algobase.h", line 88: Where: While instantiating "std::ostream_iterator<std::string, char, std::char_traits<char>>::operator=(const std::string &)".
      "/build/sebor/dev/stdlib/include/rw/_algobase.h", line 88: Where: Instantiated from non-template code.
      1 Error(s) and 1 Warning(s) detected.
      make: *** [spell.o] Error 1
      make: Target `all' not remade because of errors.
      make: Leaving directory `/build/sebor/sunpro-5.7-8d/examples'

      Attachments

        Activity

          People

            sebor Martin Sebor
            sebor Martin Sebor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: