r270216 - in /trunk/libstdc++-v3: ChangeLog inc...

ville@gcc.gnu.org ville@gcc.gnu.org
Mon Apr 8 19:45:00 GMT 2019


Author: ville
Date: Mon Apr  8 19:45:48 2019
New Revision: 270216

URL: https://gcc.gnu.org/viewcvs?rev=270216&root=gcc&view=rev
Log:
Fix visit<R> for variant.

* include/std/variant (__do_visit): Add a template parameter
for enforcing same return types for visit.
(__gen_vtable_impl): Likewise.
(_S_apply_single_alt): Adjust.
(__visit_invoke_impl): New. Handle casting to void.
(__do_visit_invoke): New. Enforces same return types.
(__do_visit_invoke_r): New. Converts return types.
(__visit_invoke): Adjust.
(__gen_vtable):  Add a template parameter for enforcing
same return types for visit.
* testsuite/20_util/variant/visit_r.cc: Add a test for a visitor with
different return types.
* testsuite/20_util/variant/visit_neg.cc: New. Ensures that
visitors with different return types don't accidentally
compile with regular visitation.

Added:
    trunk/libstdc++-v3/testsuite/20_util/variant/visit_neg.cc
      - copied, changed from r270215, trunk/libstdc++-v3/testsuite/20_util/variant/visit_r.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/std/variant
    trunk/libstdc++-v3/testsuite/20_util/variant/visit_r.cc



More information about the Libstdc++-cvs mailing list