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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [offsetof1.C] - Diff between revs 301 and 338

Only display areas with differences | Details | Blame | View Log

Rev 301 Rev 338
// PR c++/27601
// PR c++/27601
// Origin: Patrik Hägglund  
// Origin: Patrik Hägglund  
// { dg-do compile }
// { dg-do compile }
struct bar {
struct bar {
  static int foo;
  static int foo;
  static int baz();
  static int baz();
};
};
int a = __builtin_offsetof(bar, foo);  // { dg-error "static data member" }
int a = __builtin_offsetof(bar, foo);  // { dg-error "static data member" }
int av = __builtin_offsetof(volatile bar, foo);  // { dg-error "static data member" }
int av = __builtin_offsetof(volatile bar, foo);  // { dg-error "static data member" }
int b = __builtin_offsetof(bar, baz);  // { dg-error "member function" }
int b = __builtin_offsetof(bar, baz);  // { dg-error "member function" }
int b0 = __builtin_offsetof(bar, baz[0]);  // { dg-error "function" }
int b0 = __builtin_offsetof(bar, baz[0]);  // { dg-error "function" }
int bv0 = __builtin_offsetof(volatile bar, baz[0]);  // { dg-error "function" }
int bv0 = __builtin_offsetof(volatile bar, baz[0]);  // { dg-error "function" }
int c = __builtin_offsetof(bar, ~bar);  // { dg-error "member function" }
int c = __builtin_offsetof(bar, ~bar);  // { dg-error "member function" }
typedef int I;
typedef int I;
enum E { };
enum E { };
int d = __builtin_offsetof(I, ~I);  // { dg-error "destructor" }
int d = __builtin_offsetof(I, ~I);  // { dg-error "destructor" }
int e = __builtin_offsetof(E, ~E);  // { dg-error "destructor" }
int e = __builtin_offsetof(E, ~E);  // { dg-error "destructor" }
 
 

powered by: WebSVN 2.1.0

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