Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/ext/builtin-offsetof3.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
131 | 1 // PR c++/85061 |
2 // { dg-do compile } | |
3 | |
4 struct B { int a, b; }; | |
5 struct A | |
6 { | |
7 static int x[2]; | |
8 static int y; | |
9 static B z; | |
10 }; | |
11 | |
12 int i = __builtin_offsetof (volatile A, x[0]); // { dg-error "cannot apply 'offsetof' to static data member 'A::x'" } | |
13 int j = __builtin_offsetof (volatile A, y); // { dg-error "cannot apply 'offsetof' to static data member 'A::y'" } | |
14 int k = __builtin_offsetof (volatile A, z.a); // { dg-error "cannot apply 'offsetof' to a non constant address" } |