[libcxx-commits] [PATCH] D54410: [libc++] Add C++17 deduction guides for std::function

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 18 10:40:37 PDT 2019


ldionne added inline comments.


================
Comment at: libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.fail.cpp:18
+// The deduction guides for std::function do not handle rvalue-ref qualified
+// call operators and C-style variadics. Make sure we stick to the specification.
+
----------------
Quuxplusone wrote:
> Mention the LWG issue here, if it gets a number assigned in time?
There's no issue yet. I'll add it when I get a number.


================
Comment at: libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_ptr.pass.cpp:111
+  }
+}
----------------
Quuxplusone wrote:
> I think there should additionally be unit tests for:
> - `std::function f = nullptr;` does not compile
> - `std::function<int(int)> g; std::function f = g;` deduces `int(int)`
> - `std::function<int(int)> g; std::function f = std::move(g);` deduces `int(int)`
> - `std::function<int(int&&)> g; std::function f = g;` deduces `int(int&&)`
> - `std::function<int(int&&)> g; std::function f = std::move(g);` deduces `int(int&&)`
> 
> These could be in new test files, or shoehorned into the existing ones somehow, I don't care.
Good catches.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D54410





More information about the libcxx-commits mailing list