[libcxx-commits] [PATCH] D145376: [libc++] add declval failure assertion for instantiation

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 17 14:50:11 PDT 2023


EricWF added a comment.
Herald added a subscriber: mikhail.ramalho.

Is this code ODR used? I suspect it is, and so it's not valid, but I'm not sure and I ran into a bunch of different instances of this pattern while testing this change.

  template <class T>
  decltype(auto) compute_return_type() {
      // ...
      // stuff that makes this function look reasonable...
      // ...
      return std::declval<T>();
  }
  
  using MyT = decltype(compute_return_type<int>());


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

https://reviews.llvm.org/D145376



More information about the libcxx-commits mailing list