[libcxx-commits] [PATCH] D97394: [libc++] [C++2b] [P2162] Allow inheritance from std::variant.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 3 16:28:57 PST 2021


ldionne added inline comments.


================
Comment at: libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp:379
+  using xT [[maybe_unused]] = decltype(
+      std::visit(visitor_of_everything{}, std::declval<EvilVariant2>()));
+  using xTref [[maybe_unused]] = decltype(
----------------
curdeius wrote:
> tcanens wrote:
> > ldionne wrote:
> > > Is there a reason why you're only calling those in an unevaluated context? Can't we actually call and "run" them (even though I understand it's trivial)?
> > Constructing the `type_info` base class might be a bit tricky...
> Indeed, that was the reason why I just used unevaluated context.
> I'll try to do something else instead, because the reason for using `type_info` that both `variant` and `type_info` has `__impl` member that is ambiguous when calling `visit` (prior to this patch).
Oh, I hadn't thought of that. Yes, that's obvious now :-).

Feel free to disregard this comment and leave it unevaluated, or to do whatever you were thinking about with a hand-made class.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97394



More information about the libcxx-commits mailing list