blob: f136cbd50510e6458d6480f57e5b2883e69cff99 (
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
|
static void test_const(volatile int x)
{
const int x = 0;
typeof(1?x:x) i3; i3 = 0; // should be OK
typeof(+x) i4; i4 = 0; // should be OK
typeof(-x) i5; i5 = 0; // should be OK
typeof(!x) i6; i6 = 0; // should be OK
typeof(x+x) i7; i7 = 0; // should be OK
}
static void test_volatile(void)
{
volatile int x = 0;
int *pp;
typeof(1?x:x) i3; pp = &i3; // should be OK
typeof(+x) i4; pp = &i4; // should be OK
typeof(-x) i5; pp = &i5; // should be OK
typeof(!x) i6; pp = &i6; // should be OK
typeof(x+x) i7; pp = &i7; // should be OK
}
/*
* check-name: unqual02
* check-command: sparse -Wno-declaration-after-statement $file
*/
|