Fortran: checking of pointer targets for structure constructors [PR56423]
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-mangle7.C
blobc7946a2be0848ae4a7d7116d907807f279e84515
1 // PR c++/108887
2 // { dg-do compile { target c++11 } }
4 template <int __v> struct integral_constant {
5   static constexpr int value = __v;
6 };
7 using false_type = integral_constant<false>;
8 template <bool, bool, typename...> struct __result_of_impl;
9 template <typename _Functor, typename... _ArgTypes>
10 struct __result_of_impl<false, false, _Functor, _ArgTypes...> {
11   typedef decltype(0) type;
13 template <typename... _ArgTypes>
14 struct __invoke_result
15     : __result_of_impl<false_type::value, false_type::value, _ArgTypes...> {};
16 template <typename, typename _Fn, typename... _Args>
17 void __invoke_impl(_Fn __f, _Args... __args) {
18   __f(__args...);
20 template <typename, typename _Callable, typename... _Args>
21 void __invoke_r(_Callable __fn, _Args... __args) {
22   using __result = __invoke_result<_Args...>;
23   using __type = typename __result::type;
24   __invoke_impl<__type>(__fn, __args...);
26 struct QString {
27   QString(const char *);
29 template <typename> class function;
30 template <typename _Functor> struct _Base_manager {
31   static _Functor _M_get_pointer(int) { __builtin_abort (); }
33 template <typename, typename> class _Function_handler;
34 template <typename _Res, typename _Functor, typename... _ArgTypes>
35 struct _Function_handler<_Res(_ArgTypes...), _Functor> {
36   using _Base = _Base_manager<_Functor>;
37   static _Res _M_invoke(const int &__functor, _ArgTypes &&...__args) {
38     auto __trans_tmp_1 = _Base::_M_get_pointer(__functor);
39     __invoke_r<_Res>(__trans_tmp_1, __args...);
40   }
42 template <typename _Res, typename... _ArgTypes>
43 struct function<_Res(_ArgTypes...)> {
44   template <typename _Functor>
45   using _Handler = _Function_handler<_Res(_ArgTypes...), _Functor>;
46   template <typename _Functor> function(_Functor) {
47     using _My_handler = _Handler<_Functor>;
48     _M_invoker = _My_handler::_M_invoke;
49   }
50   using _Invoker_type = _Res (*)(const int &, _ArgTypes &&...);
51   _Invoker_type _M_invoker;
53 struct QRegularExpression {
54   QRegularExpression(QString);
56 struct AbstractAccount {
57   void get(function<void(AbstractAccount *)>,
58            function<void(AbstractAccount *)>);
60 struct AbstractTimelineModel {
61   AbstractAccount m_account;
63 struct LinkPaginationTimelineModel : AbstractTimelineModel {
64   void fillTimeline();
66 void LinkPaginationTimelineModel::fillTimeline() {
67   [] {};
68   m_account.get([](AbstractAccount *) { static QRegularExpression re(""); },
69                 [](AbstractAccount *) {});