Skip to content

Commit 7de598b

Browse files
committed
Add a test for "Improve robustness when handling unexpected FunctionProto type locs.".
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent c183200 commit 7de598b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

tests/Common/Common.h

+42
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,48 @@ namespace boost
842842
{
843843
template <class T> struct is_member_pointer_cv { static const bool value = false; };
844844
template <class T, class U>struct is_member_pointer_cv<T U::*> { static const bool value = true; };
845+
846+
// all of this below tests corner cases with type locations
847+
template<class T>
848+
struct make_tuple_traits
849+
{
850+
typedef T type;
851+
852+
// commented away, see below (JJ)
853+
// typedef typename IF<
854+
// boost::is_function<T>::value,
855+
// T&,
856+
// T>::RET type;
857+
};
858+
859+
namespace detail
860+
{
861+
struct swallow_assign;
862+
typedef void (detail::swallow_assign::*ignore_t)();
863+
struct swallow_assign
864+
{
865+
swallow_assign(ignore_t(*)(ignore_t));
866+
template<typename T>
867+
swallow_assign const& operator=(const T&) const;
868+
};
869+
870+
swallow_assign::swallow_assign(ignore_t (*)(ignore_t))
871+
{
872+
}
873+
874+
template<typename T>
875+
swallow_assign const& swallow_assign::operator=(const T&) const
876+
{
877+
return *this;
878+
}
879+
880+
} // namespace detail
881+
882+
template<>
883+
struct make_tuple_traits<detail::ignore_t(detail::ignore_t)>
884+
{
885+
typedef detail::swallow_assign type;
886+
};
845887
}
846888

847889
template <std::size_t N, std::size_t... I>

0 commit comments

Comments
 (0)