]> granicus.if.org Git - clang/commit
Improve the error message when a function overload candidate is rejected
authorKaelyn Uhrain <rikka@google.com>
Tue, 19 Jun 2012 00:37:47 +0000 (00:37 +0000)
committerKaelyn Uhrain <rikka@google.com>
Tue, 19 Jun 2012 00:37:47 +0000 (00:37 +0000)
commit0d3317e0a2e0adb57ce8d075ebdcb41a3f939805
tree2d666777b153f960802924874b142c2d93fc33ee
parent3065cf9ecc883715edbd3bf875acb2cab531138e
Improve the error message when a function overload candidate is rejected
because it expects a reference and receives a non-l-value.

For example, given:

  int foo(int &);
  template<int x> void b() { foo(x); }

clang will now print "expects an l-value for 1st argument" instead of
"no known conversion from 'int' to 'int &' for 1st argument". The change
in wording (and associated code to detect the case) was prompted by
comment #5 in PR3104, and should be the last bit of work needed for the
bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158691 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaOverload.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp
test/Misc/integer-literal-printing.cpp
test/SemaCXX/user-defined-conversions.cpp