[all-commits] [llvm/llvm-project] 907cef: Always deduce the lengths of contained parameter p...

Richard Smith via All-commits all-commits at lists.llvm.org
Mon Jan 6 17:26:01 PST 2020


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

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/test/CXX/drs/dr13xx.cpp
    M clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
    M clang/test/SemaTemplate/alias-templates.cpp
    M clang/test/SemaTemplate/deduction.cpp
    M clang/test/SemaTemplate/pack-deduction.cpp

  Log Message:
  -----------
  Always deduce the lengths of contained parameter packs when deducing a
pack expansion.

Previously, if all parameter / argument pairs for a pack expansion
deduction were non-deduced contexts, we would not deduce the arity of
the pack, and could end up deducing a different arity (leading to
failures during substitution) or defaulting to an arity of 0 (leading to
bad diagnostics about passing the wrong number of arguments to a
variadic function). Instead, we now always deduce the arity for all
involved packs any time we deduce a pack expansion.

This will result in less substitution happening in some cases, which
could avoid non-SFINAEable errors, and should generally improve the
quality of diagnostics when passing initializer lists to variadic
functions.




More information about the All-commits mailing list