[PATCH] D67647: [Consumed] Refactor handleCall to take function argument list. NFC.

Nicholas Allegra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 18:48:49 PDT 2019


comex updated this revision to Diff 225557.
comex marked 2 inline comments as done.
comex added a comment.

So, I landed this patch but had to revert it as it broke the build on MSVC (and only MSVC).  That was almost a month ago, but I haven't gotten back around to this until now – sorry :|

In this updated patch, I switched is_random_iterator from a constexpr function:

  template <typename T>
  constexpr bool is_random_iterator() {
    return std::is_same<
      typename std::iterator_traits<T>::iterator_category,
      std::random_access_iterator_tag>::value;
  }

to a type alias:

  template <typename T>
  using is_random_iterator =
    std::is_same<typename std::iterator_traits<T>::iterator_category,
                 std::random_access_iterator_tag>;

and changed the uses accordingly.  For some reason, MSVC thought the two overloads of `drop_begin`, one with `enable_if<!is_random_iterator<T>()>` and one with `enable_if<is_random_iterator<T>()>`, were duplicate definitions.  But with `is_random_iterator` changed to a type alias, MSVC is fine with them.  GCC and Clang think both versions are valid, so I think it's just an MSVC bug.

Simplified example for reference: https://gcc.godbolt.org/z/niXCy4


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67647/new/

https://reviews.llvm.org/D67647

Files:
  clang/include/clang/AST/Stmt.h
  clang/lib/Analysis/Consumed.cpp
  llvm/include/llvm/ADT/STLExtras.h
  llvm/include/llvm/ADT/iterator_range.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67647.225557.patch
Type: text/x-patch
Size: 6817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191018/02d6ae52/attachment.bin>


More information about the llvm-commits mailing list