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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [c1x-anon-struct-2.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* Test for anonymous structures and unions in C1X.  Test for invalid
2
   cases.  */
3
/* { dg-do compile } */
4
/* { dg-options "-std=c1x -pedantic-errors" } */
5
 
6
typedef struct s0
7
{
8
  int i;
9
} s0;
10
 
11
struct s1
12
{
13
  int a;
14
  struct s0; /* { dg-error "declaration does not declare anything" } */
15
};
16
 
17
struct s2
18
{
19
  int a;
20
  s0; /* { dg-error "declaration does not declare anything" } */
21
};
22
 
23
struct s3
24
{
25
  struct
26
  {
27
    int i;
28
  };
29
  struct
30
  {
31
    int i; /* { dg-error "duplicate member" } */
32
  };
33
};
34
 
35
struct s4
36
{
37
  int a;
38
  struct s
39
  {
40
    int i;
41
  }; /* { dg-error "declaration does not declare anything" } */
42
};
43
 
44
struct s5
45
{
46
  struct
47
  {
48
    int i;
49
  } a;
50
  int b;
51
} x;
52
 
53
void
54
f (void)
55
{
56
  x.i = 0; /* { dg-error "has no member" } */
57
}

powered by: WebSVN 2.1.0

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