comparison gcc/testsuite/g++.old-deja/g++.other/sizeof4.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
15 15
16 void fn () {} 16 void fn () {}
17 17
18 int main (int argc, char **argv) 18 int main (int argc, char **argv)
19 { 19 {
20 sizeof (s); // { dg-error "" } incomplete 20 sizeof (s); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
21 sizeof (0, s); // { dg-error "" } incomplete 21 sizeof (0, s); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
22 sizeof (argc ? s : s); // { dg-error "" } incomplete 22 sizeof (argc ? s : s); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
23 23
24 sizeof (arys); // { dg-error "" } incomplete 24 sizeof (arys); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
25 sizeof (0, arys); // { dg-error "" } incomplete 25 sizeof (0, arys); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
26 sizeof (argc ? arys : arys); // { dg-error "" } incomplete 26 sizeof (argc ? arys : arys); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
27 27
28 sizeof (aryt); // { dg-error "" } incomplete 28 sizeof (aryt); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
29 sizeof (0, aryt); // { dg-error "" } incomplete 29 sizeof (0, aryt); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
30 sizeof (argc ? aryt : aryt); // { dg-error "" } incomplete 30 sizeof (argc ? aryt : aryt); // { dg-error "3:invalid application of .sizeof. to incomplete type" } incomplete
31 31
32 sizeof (fn); // { dg-error "" } cannot take size of function 32 sizeof (fn); // { dg-error "11:ISO C\\+\\+ forbids applying .sizeof." } cannot take size of function
33 sizeof (0, fn); // { dg-error "" } cannot take size of function 33 sizeof (0, fn); // { dg-error "3:invalid application of .sizeof. to a function type" } cannot take size of function
34 sizeof (argc ? fn : fn); // { dg-error "" } cannot take size of function 34 sizeof (argc ? fn : fn); // { dg-error "3:invalid application of .sizeof. to a function type" } cannot take size of function
35 35
36 sizeof (&fn); // ok 36 sizeof (&fn); // ok
37 sizeof (0, &fn); // ok 37 sizeof (0, &fn); // ok
38 sizeof (argc ? &fn : &fn); // ok 38 sizeof (argc ? &fn : &fn); // ok
39 39