blob: 5708cf84e2f391c9dfe6674f13b22d6705ed3a96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// { dg-do compile { target c++1y } }
#include <typeinfo>
void f(int n)
{
int a[n];
int aa[n][n]; // { dg-error "" }
&a; // { dg-error "" }
sizeof a; // { dg-error "" }
typeid(a); // { dg-error "" }
decltype(a) a2; // { dg-error "" }
typedef int at[n]; // { dg-error "" }
int (*p)[n]; // { dg-error "" }
int (&r)[n] = a; // { dg-error "" }
struct A
{
int a[n]; // { dg-error "" }
};
}
template <class T>
void g(int n)
{
int a[n];
int aa[n][n]; // { dg-error "" }
&a; // { dg-error "" }
sizeof a; // { dg-error "" }
typeid(a); // { dg-error "" }
decltype(a) a2; // { dg-error "" }
typedef int at[n]; // { dg-error "" }
int (*p)[n]; // { dg-error "" }
int (&r)[n] = a; // { dg-error "" }
struct A
{
int a[n]; // { dg-error "" }
};
}
template void g<int>(int);
|