Fix PR27374 - Remove the implicit reduced-arity-extension in tuple.
authorEric Fiselier <eric@efcs.ca>
Thu, 8 Dec 2016 23:57:08 +0000 (23:57 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 8 Dec 2016 23:57:08 +0000 (23:57 +0000)
commitbd688258baf97e840c2bd0c4c307503042b1620c
treecbb8347d38586b15fa0b624fb0dfa7cb83844194
parent568196bf7b6eb3528df71d017c59cbf25ad63141
Fix PR27374 - Remove the implicit reduced-arity-extension in tuple.

This patch removes libc++'s tuple extension which allowed it to be
constructed from fewer initializers than elements; with the remaining
elements being default constructed. However the implicit version of
this extension breaks conforming code. For example:

    int fun(std::string);
    int fun(std::tuple<std::string, int>);
    int x = fun("hello"); // ambigious

Because existing code may already depend on this extension it can be re-enabled
by defining _LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION.

Note that the explicit version of this extension is still supported,
although it's somewhat less useful than the implicit one.

llvm-svn: 289158
libcxx/docs/UsingLibcxx.rst
libcxx/include/tuple
libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/disable_reduced_arity_initialization_extension.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/enable_reduced_arity_initialization_extension.pass.cpp [new file with mode: 0644]
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp