Re: c++/10864: [diagnostic] Unreadable error message for "no match for 'A < B' operator" if A,B are templates

"Giovanni Bajo" <[email protected]>
Newsgroups gmane.comp.gcc.bugs,gmane.comp.gcc.prs
Message-ID <27e701c31e7c$dc8b23b0$c64f2697@bagio>
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10864

For reference:

GCC with StlFilt:
pr10864.cpp: In member function
   `bool less<X<vector<string>, vector<string> > >::foo()':
pr10864.cpp:10:   instantiated from here
pr10864.cpp:5: error: no match for
   `X<vector<string>, vector<string> > < X<vector<string>, vector<string> >'
    operator


Comeau:
"pr10864.cpp", line 5: error: no operator "<" matches these operands
            operand types are: 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>>>
        bool foo () { return T() < T(); }
                                 ^

          detected during instantiation of "bool less<T>::foo() [with
                    T=X<std::vector<std::string,
std::allocator<std::string>>,
                    std::vector<std::string, std::allocator<std::string>>>]"
                    at line 10


Comeau with StlFilt (yes, it screws indentation a little):
pr10864.cpp(5): error: no operator "<" matches these operands
    operand types are: X<vector<string>, vector<string>> < X<vector<string>,
  vector<string>>
        bool foo () { return T() < T(); }
                                 ^
          detected during instantiation of "bool less<X<vector<string>,
   vector<string>>>::foo()" at line 10


Giovanni Bajo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.