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++/16070] Bad error message


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

Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #6 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-10-22 14:02:29 UTC ---
@Ivan, GCC 4.7 gives:

pr16070.cc:5:20: error: no matching function for call to âBar(<unresolved
overloaded function type>)â
pr16070.cc:5:20: note: candidates are:
pr16070.cc:3:9: note: template<class T> void Bar(const T&)
pr16070.cc:3:9: note:   template argument deduction/substitution failed:
pr16070.cc:5:20: note:   couldn't deduce template parameter âTâ
pr16070.cc:4:9: note: void Bar(int)
pr16070.cc:4:9: note:   no known conversion for argument 1 from â<unresolved
overloaded function type>â to âintâ

which seems better, no?

Compare to Clang:

/tmp/webcompile/_30708_0.cc:5:15: error: no matching function for call to 'Bar'
int main() {  Bar(f); }
              ^~~
/tmp/webcompile/_30708_0.cc:4:9: note: candidate function not viable: no
overload of 'f' matching 'int' for 1st argument
void    Bar(int i) {}
        ^
/tmp/webcompile/_30708_0.cc:3:9: note: candidate template ignored: couldn't
infer template argument 'T'
void    Bar(const T& t) {}
        ^

so g++ is not as good as clang, but it got closer at GCC 4.7. Perhaps g++ could
handle better the "unresolved overloaded function type"?

(Gosh! how can clang be that good at this?)


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