[all-commits] [llvm/llvm-project] b39f6a: [ADT] Extend EnableIfCallable for callables with i...

Fehr Mathieu via All-commits all-commits at lists.llvm.org
Mon Sep 13 12:17:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b39f6a79ee88ea0c626a467ade032f052c9ce139
      https://github.com/llvm/llvm-project/commit/b39f6a79ee88ea0c626a467ade032f052c9ce139
  Author: Fehr Mathieu <mathieu.fehr at gmail.com>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

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

  Log Message:
  -----------
  [ADT] Extend EnableIfCallable for callables with incomplete returns

std::is_convertible has no defined behavior when its arguments
are incomplete, even if they are equal. In practice, it returns false.
Adding std::is_same allows us to use the constructor using a callable,
even if the return value is incomplete. We also check the case where
we convert a T into a const T.

Reviewed By: DaniilSuchkov

Differential Revision: https://reviews.llvm.org/D104703

Committer: Daniil Suchkov <dsuchkov at azul.com>




More information about the All-commits mailing list