Commit 507ea98d by Paolo Carlini Committed by Paolo Carlini

re PR c++/78006 (Segmentation fault with 'using' and generic lambda trailing return types)

2017-10-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/78006
	* g++.dg/cpp1y/auto-fn40.C: New.

From-SVN: r253621
parent d6b605f6
2017-10-10 Paolo Carlini <paolo.carlini@oracle.com> 2017-10-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/78006
* g++.dg/cpp1y/auto-fn40.C: New.
2017-10-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81032 PR c++/81032
* g++.dg/cpp1y/lambda-generic-ice6.C: New. * g++.dg/cpp1y/lambda-generic-ice6.C: New.
......
// PR c++/78006
// { dg-do compile { target c++14 } }
template<typename T> T&& declval() noexcept;
template<typename... _Tp>
struct common_type;
template<typename _Tp>
struct common_type<_Tp>
{ typedef _Tp type; };
template<typename _Tp, typename _Up>
struct common_type<_Tp, _Up>
{ typedef decltype(true ? declval<_Tp>() : declval<_Up>()) type; };
template<typename _Tp, typename _Up, typename... _Vp>
struct common_type<_Tp, _Up, _Vp...>
{
typedef typename
common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
};
template<typename... _Tp>
using common_type_t = typename common_type<_Tp...>::type;
template <typename... TFs>
auto x(TFs&&... fs)
{
using rt = common_type_t<decltype(fs(0))...>;
return [](auto) -> rt { };
}
int main()
{
x([](int){})(0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment