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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [offsetof1.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/27601
2
// Origin: Patrik Hägglund  
3
// { dg-do compile }
4
 
5
struct bar {
6
  static int foo;
7
  static int baz();
8
};
9
 
10
int a = __builtin_offsetof(bar, foo);  // { dg-error "static data member" }
11
int av = __builtin_offsetof(volatile bar, foo);  // { dg-error "static data member" }
12
int b = __builtin_offsetof(bar, baz);  // { dg-error "member function" }
13
int b0 = __builtin_offsetof(bar, baz[0]);  // { dg-error "function" }
14
int bv0 = __builtin_offsetof(volatile bar, baz[0]);  // { dg-error "function" }
15
int c = __builtin_offsetof(bar, ~bar);  // { dg-error "member function" }
16
 
17
typedef int I;
18
enum E { };
19
 
20
int d = __builtin_offsetof(I, ~I);  // { dg-error "destructor" }
21
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.