[all-commits] [llvm/llvm-project] e3eaff: Allow incomplete template types in unique_function...

Yevgeny Rouban via All-commits all-commits at lists.llvm.org
Fri May 21 00:10:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e3eaff10b29d8bb85a0d09e6bb72fbdb7cc9c3ea
      https://github.com/llvm/llvm-project/commit/e3eaff10b29d8bb85a0d09e6bb72fbdb7cc9c3ea
  Author: Yevgeny Rouban <yrouban at azul.com>
  Date:   2021-05-21 (Fri, 21 May 2021)

  Changed paths:
    M llvm/include/llvm/ADT/FunctionExtras.h
    M llvm/unittests/ADT/FunctionExtrasTest.cpp

  Log Message:
  -----------
  Allow incomplete template types in unique_function arguments

We can't declare unique_function that has in its arguments a reference to
a template type with an incomplete argument.
For instance, we can't declare unique_function<void(SmallVectorImpl<A>&)>
when A is forward declared.

This is because SFINAE will trigger a hard error in this case, when instantiating
IsSizeLessThanThresholdT with the incomplete type.

This patch specialize AdjustedParamT for references to remove this error.

Committed on behalf of: @math-fehr (Fehr Mathieu)

Reviewed By: DaniilSuchkov, yrouban




More information about the All-commits mailing list