Fortran: checking of pointer targets for structure constructors [PR56423]
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-const3.C
blob1767dd7117082629b95a1b658c1cd82ece2c49e9
1 // PR c++/60992
2 // { dg-do compile { target c++11 } }
4 struct ScopeGuardGenerator { };
6 struct FF
8   template < class F, class ... Ts >
9   void
10   operator () (F & ...)                 // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
11   {
12     const int n = sizeof ... (Ts) + 1;
13     void *mutexes[n];
14     auto _on_scope_exit_var_0 =
15       ScopeGuardGenerator () + [&mutexes] { };
16   }
19 template < class F >
20 int operator+ (ScopeGuardGenerator, F) { return 1; }
22 struct D
24   template < class T0, class T1, class T2, class ... T >
25   void
26   operator () (T0, T1, const T2 & t2, T & ... t)
27   {
28     base (t2, t ...);
29   }
30   FF base;
33 D run_with_locks;
35 void Fn ()
37   run_with_locks ([] { }, 0, 0);