From 633fe505fe109caa7a154d66fd534667a1a5e62e Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 14 Dec 2015 17:34:03 +0000 Subject: [PATCH] Add add_lvalue_ref tests for a few function types, with a note why not more git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@255513 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../meta.trans.ref/add_lvalue_ref.pass.cpp | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp index 8150ce04e..5886d9826 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp @@ -22,6 +22,26 @@ void test_add_lvalue_reference() #endif } +template +void test_function0() +{ + static_assert((std::is_same::type, F&>::value), ""); +#if _LIBCPP_STD_VER > 11 + static_assert((std::is_same, F&>::value), ""); +#endif +} + +template +void test_function1() +{ + static_assert((std::is_same::type, F>::value), ""); +#if _LIBCPP_STD_VER > 11 + static_assert((std::is_same, F>::value), ""); +#endif +} + +struct Foo {}; + int main() { test_add_lvalue_reference(); @@ -31,4 +51,20 @@ int main() test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); + +// LWG 2101 specifically talks about add_lvalue_reference and functions. +// The term of art is "a referenceable type", which a cv- or ref-qualified function is not. + test_function0(); +// test_function1(); +// test_function1(); +// test_function1(); +// test_function1(); +// test_function1(); + + test_function0(); +// test_function1(); +// test_function1(); +// test_function1(); +// test_function1(); +// test_function1(); }