From 9ce1745464adcb1e22bbf448a664ba44adad3f46 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 15 Dec 2016 06:38:07 +0000 Subject: [PATCH] Add test case for PR31384 llvm-svn: 289774 --- .../tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp new file mode 100644 index 0000000..9fde7ac --- /dev/null +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp @@ -0,0 +1,38 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// + +// template tuple(TupleLike&&); // libc++ extension + +// See llvm.org/PR31384 + +#include +#include + + +int count = 0; + +template +struct derived : std::tuple { + using std::tuple::tuple; + template + operator std::tuple() && { + ++count; + return {}; + } +}; + +int main() { + std::tuple foo = derived{42}; + assert(count == 1); +} -- 2.7.4