Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/ext/flexary12.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 |
---|---|
10 }; | 10 }; |
11 | 11 |
12 void f1 () | 12 void f1 () |
13 { | 13 { |
14 // This is the meat of the test from c++/69290: | 14 // This is the meat of the test from c++/69290: |
15 struct A a | 15 static struct A a |
16 = { "c" }; // { dg-error "invalid conversion from .const char\\*. to .int." } | 16 = { "c" }; // { dg-error "invalid conversion from .const char\\*. to .int." } |
17 | 17 |
18 (void)&a; | 18 (void)&a; |
19 } | 19 } |
20 | 20 |
25 int a []; | 25 int a []; |
26 }; | 26 }; |
27 | 27 |
28 void f2 () | 28 void f2 () |
29 { | 29 { |
30 struct B b1 | 30 static struct B b1 |
31 = { 0, "c" }; // { dg-error "invalid conversion from .const char\\*. to .int." } | 31 = { 0, "c" }; // { dg-error "invalid conversion from .const char\\*. to .int." } |
32 | 32 |
33 (void)&b1; | 33 (void)&b1; |
34 | 34 |
35 const char s[] = "c"; | 35 const char s[] = "c"; |
36 struct B b2 | 36 static struct B b2 |
37 = { 0, s }; // { dg-error "invalid conversion from .const char\\*. to .int." } | 37 = { 0, s }; // { dg-error "invalid conversion from .const char\\*. to .int." } |
38 | 38 |
39 (void)&b2; | 39 (void)&b2; |
40 } | 40 } |
41 | 41 |
55 T a []; // { dg-error "flexible array member" } | 55 T a []; // { dg-error "flexible array member" } |
56 }; | 56 }; |
57 | 57 |
58 void f3 () | 58 void f3 () |
59 { | 59 { |
60 struct C<double> cd | 60 static struct C<double> cd |
61 = { "c" }; // { dg-error "cannot convert .const char\\*. to .double." } | 61 = { "c" }; // { dg-error "cannot convert .const char\\*. to .double." } |
62 | 62 |
63 (void)&cd; | 63 (void)&cd; |
64 } | 64 } |