[all-commits] [llvm/llvm-project] 251955: When diagnosing the lack of a viable conversion fu...

Richard Smith via All-commits all-commits at lists.llvm.org
Thu Jan 9 15:15:19 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 25195541349b1d6dfc03bf7511483110bda69b29
      https://github.com/llvm/llvm-project/commit/25195541349b1d6dfc03bf7511483110bda69b29
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-01-09 (Thu, 09 Jan 2020)

  Changed paths:
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Overload.h
    M clang/lib/Sema/SemaInit.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp
    M clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp
    M clang/test/CXX/dcl.decl/dcl.init/p14-0x.cpp
    M clang/test/CXX/drs/dr15xx.cpp
    M clang/test/CXX/drs/dr1xx.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
    M clang/test/CXX/over/over.match/over.match.funcs/over.match.copy/p1.cpp
    M clang/test/CXX/special/class.inhctor/p3.cpp
    M clang/test/PCH/cxx-explicit-specifier.cpp
    M clang/test/SemaCXX/conversion-function.cpp
    M clang/test/SemaCXX/convert-to-bool.cpp
    M clang/test/SemaCXX/converting-constructor.cpp
    M clang/test/SemaCXX/copy-initialization.cpp
    M clang/test/SemaCXX/cxx2a-explicit-bool.cpp
    M clang/test/SemaCXX/default1.cpp
    M clang/test/SemaCXX/explicit.cpp

  Log Message:
  -----------
  When diagnosing the lack of a viable conversion function, also list
explicit functions that are not candidates.

It's not always obvious that the reason a conversion was not possible is
because the function you wanted to call is 'explicit', so explicitly say
if that's the case.

It would be nice to rank the explicit candidates higher in the
diagnostic if an implicit conversion sequence exists for their
arguments, but unfortunately we can't determine that without potentially
triggering non-immediate-context errors that we're not permitted to
produce.




More information about the All-commits mailing list