This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16068] Bad error message


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-19 01:13 -------
ICC 6.0 gives:
pr16070.cc
pr16070.cc(9): error: no operator "<<" matches these operands
            operand types are: A << <unknown-type>
      a << f;
        ^

compilation aborted for pr16070.cc (code 2)

Reduced:
template <class T> void f(T);
class A{};
template<typename T>
void    operator<<(const A&, const T& t) {}
int main() {  A a;  a << f; }

3.0.4 and 2.95.3 gives:
tin:~/src/gnu/gcctest>~/ia32_linux_gcc3_0/bin/gcc pr16070.cc
pr16070.cc: In function `int main()':
pr16070.cc:9: no match for `A& << <unknown type>' operator
tin:~/src/gnu/gcctest>~/ia32_linux_gcc2_95//bin/gcc pr16070.cc
pr16070.cc: In function `int main()':
pr16070.cc:9: no match for `A & << {unknown type}'

They are slightly better but still bad (really ICC's diagnostic is just as bad as GCC's here).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-19 01:13:19
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]