131
|
1 // PR c++/87152
|
|
2 // { dg-do compile }
|
|
3 // { dg-options "-std=c++2a" }
|
|
4
|
|
5 static const int a[] = { 1, 2, 3, 4, 5 };
|
|
6 extern void foo (int);
|
|
7 extern void bar (int, int);
|
|
8
|
|
9 constexpr int
|
|
10 baz ()
|
|
11 {
|
|
12 return 6;
|
|
13 }
|
|
14
|
|
15 template<typename T>
|
|
16 void
|
|
17 fn1 (T i)
|
|
18 {
|
|
19 for ((i += 2); auto x : a)
|
|
20 foo (i);
|
|
21
|
|
22 for (auto j = 0, k = 0; auto x : a)
|
|
23 bar (j + k, x);
|
|
24
|
|
25 for (constexpr int j = baz (); auto x : a)
|
|
26 bar (x, j);
|
|
27 }
|
|
28
|
|
29 void
|
|
30 do_fn1 ()
|
|
31 {
|
|
32 fn1<int>(10);
|
|
33 }
|