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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [offsetof6.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 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.