| 1 |
// PR c++/113976 |
| 2 |
// { dg-do run { target c++14 } } |
| 3 |
|
| 4 |
int |
| 5 |
foo () |
| 6 |
{ |
| 7 |
return 42; |
| 8 |
} |
| 9 |
|
| 10 |
template <int N> |
| 11 |
const int a = foo (); |
| 12 |
const int *b = &a <0>; |
| 13 |
template <int N> |
| 14 |
const int c = foo (); |
| 15 |
template const int c <0>; |
| 16 |
template <int N> |
| 17 |
const int d = foo (); |
| 18 |
const int *e = &d <0>; |
| 19 |
template const int d <0>; |
| 20 |
template <int N> |
| 21 |
const int f = foo (); |
| 22 |
template const int f <0>; |
| 23 |
const int *g = &f <0>; |
| 24 |
struct S { int a, b; }; |
| 25 |
template <int N> |
| 26 |
const S h = { 42, foo () }; |
| 27 |
const S *i = &h <0>; |
| 28 |
template <int N> |
| 29 |
const S j = { 42, foo () }; |
| 30 |
template const S j <0>; |
| 31 |
template <int N> |
| 32 |
const S k = { 42, foo () }; |
| 33 |
const S *l = &k <0>; |
| 34 |
template const S k <0>; |
| 35 |
template <int N> |
| 36 |
const S m = { 42, foo () }; |
| 37 |
template const S m <0>; |
| 38 |
const S *n = &m <0>; |
| 39 |
|
| 40 |
int |
| 41 |
main () |
| 42 |
{ |
| 43 |
} |