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

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 3 16:52:37 PST 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp:376
+
+  struct EvilVariant2 : std::variant<int, long>, std::type_info {};
+
----------------
Would it be appropriate to also test the behavior of `struct X : std::variant<int>, std::variant<long> {}` and `struct Y : private std::variant<int> {}`? I don't think we expect either of those to support `std::visit`, but I wonder if they're supposed to SFINAE away cleanly or give some awful template error message or what.


================
Comment at: libcxx/utils/generate_feature_test_macro_components.py:631
     "name": "__cpp_lib_variant",
-    "values": { "c++17": 201606 },
+    "values": { "c++17": 201606, "c++2b": 202102 },
     "headers": ["variant"],
----------------
Since you're making the change in all language versions (IIUC), shouldn't the feature-test macro have the higher value in all language versions? (Has this situation ever come up in WG21 before? what did the Committee think vendors should do?)


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