OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [other/] [offsetof6.C] - Blame information for rev 316

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// Contributed by Dodji Seketeli 
2
// Origin PR c++/38699
3
// { dg-do compile }
4
 
5
template
6
struct A
7
{
8
  const T *p;
9
};
10
 
11
struct B
12
{
13
  A a;
14
};
15
 
16
template class A;
17
 
18
void
19
f0 ()
20
{
21
  __builtin_offsetof(A, p); // OK
22
  __builtin_offsetof(A, p[1]); // { dg-error "non constant address" }
23
  __builtin_offsetof(B, a.p); // OK
24
  __builtin_offsetof(B, a.p[1]); // { dg-error "non constant address" }
25
}
26
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.