From 7de598b7aaa192e220d811d5ce173aca9096557a Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Sun, 20 Sep 2015 23:12:55 +0300 Subject: [PATCH] Add a test for "Improve robustness when handling unexpected FunctionProto type locs.". Signed-off-by: Dimitar Dobrev --- tests/Common/Common.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/Common/Common.h b/tests/Common/Common.h index e9215fb39b..8316c6b671 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -842,6 +842,48 @@ namespace boost { template struct is_member_pointer_cv { static const bool value = false; }; template struct is_member_pointer_cv { static const bool value = true; }; + + // all of this below tests corner cases with type locations + template + struct make_tuple_traits + { + typedef T type; + + // commented away, see below (JJ) + // typedef typename IF< + // boost::is_function::value, + // T&, + // T>::RET type; + }; + + namespace detail + { + struct swallow_assign; + typedef void (detail::swallow_assign::*ignore_t)(); + struct swallow_assign + { + swallow_assign(ignore_t(*)(ignore_t)); + template + swallow_assign const& operator=(const T&) const; + }; + + swallow_assign::swallow_assign(ignore_t (*)(ignore_t)) + { + } + + template + swallow_assign const& swallow_assign::operator=(const T&) const + { + return *this; + } + + } // namespace detail + + template<> + struct make_tuple_traits + { + typedef detail::swallow_assign type; + }; } template