[all-commits] [llvm/llvm-project] c56975: Fix template instantiation of a non-dependent call...

Richard Smith via All-commits all-commits at lists.llvm.org
Mon Apr 6 19:20:34 PDT 2020


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

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/test/SemaCXX/default2.cpp
    M clang/test/SemaTemplate/instantiate-init.cpp

  Log Message:
  -----------
  Fix template instantiation of a non-dependent call to an inherited
constructor with default arguments.

We used to try to rebuild the call as a call to the faked-up inherited
constructor, which is only a placeholder and lacks (for example) default
arguments. Instead, build the call by reference to the original
constructor.

In passing, add a note to say where a call that recursively uses a
default argument from within itself occurs. This is usually pretty
obvious, but still at least somewhat useful, and would have saved
significant debugging time for this particular bug.




More information about the All-commits mailing list