Re: c++/10864: [diagnostic] Unreadable error message for "no match for 'A < B' operator" if A,B are templates
Gabriel Dos Reis <[email protected]>
| Newsgroups | gmane.comp.gcc.prs |
|---|---|
| Message-ID | <[email protected]> |
The following reply was made to PR c++/10864; it has been noted by GNATS. From: Gabriel Dos Reis <[email protected]> To: [email protected] Cc: [email protected] Subject: Re: c++/10864: [diagnostic] Unreadable error message for "no match for 'A < B' operator" if A,B are templates Date: 19 May 2003 23:08:18 +0200 [email protected] writes: | g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc | y.cc: In member function `bool less<T>::foo() [with T = | X<std::vector<std::string, std::allocator<std::string> >, | std::vector<std::string, std::allocator<std::string> > >]': | y.cc:10: instantiated from here | y.cc:5: error: no match for `X<std::vector<std::string, | std::allocator<std::string> >, std::vector<std::string, | std::allocator<std::string> > > < X<std::vector<std::string, | std::allocator<std::string> >, std::vector<std::string, | std::allocator<std::string> > >' operator | | Now, that's pretty hard to read. What it says is: | no match for `A < B' operator | but the "<" is totally lost in all these template args. | I also always thought that the message was somehow | truncated, since usually in C++ there must be something | after the "operator" :-) I fully agree. I must confess that I have never been sympathetic to the way we handle messages saying "no match for bubble[tangle] operator". Sometime, they just look very strange to read. | I think it would be nice if the message could be changed | to read like | no match for operator< in expression `A < B' | That way it would be simpler to figure out which operator | exactly is missing. I think that is a very good suggestion. -- Gaby