URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// Contributed by Dodji Seketeli
|
// Contributed by Dodji Seketeli
|
// Origin PR c++/38699
|
// Origin PR c++/38699
|
// { dg-do compile }
|
// { dg-do compile }
|
|
|
template
|
template
|
struct A
|
struct A
|
{
|
{
|
const T *p;
|
const T *p;
|
};
|
};
|
|
|
struct B
|
struct B
|
{
|
{
|
A a;
|
A a;
|
};
|
};
|
|
|
template class A;
|
template class A;
|
|
|
void
|
void
|
f0 ()
|
f0 ()
|
{
|
{
|
__builtin_offsetof(A, p); // OK
|
__builtin_offsetof(A, p); // OK
|
__builtin_offsetof(A, p[1]); // { dg-error "non constant address" }
|
__builtin_offsetof(A, p[1]); // { dg-error "non constant address" }
|
__builtin_offsetof(B, a.p); // OK
|
__builtin_offsetof(B, a.p); // OK
|
__builtin_offsetof(B, a.p[1]); // { dg-error "non constant address" }
|
__builtin_offsetof(B, a.p[1]); // { dg-error "non constant address" }
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.