Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/init-bad-9.c @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* PR c/71552 - Confusing error for incorrect struct initialization */ |
2 /* { dg-do compile } */ | |
3 | |
4 struct A { void *p; }; | |
5 struct B { struct A *p; }; | |
6 struct A a; | |
7 | |
8 /* Verify that the initializer is diagnosed for its incompatibility | |
9 with the type of the object being initialized, not for its lack | |
10 of constness (which is a lesser problem). */ | |
11 struct B b = { a }; /* { dg-error "incompatible types when initializing" } */ | |
12 struct B *p = a; /* { dg-error "incompatible types when initializing" } */ |