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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [nested-redef-1.c] - Blame information for rev 455

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

Line No. Rev Author Line
1 149 jeremybenn
/* Test diagnosis of nested tag redefinitions.  */
2
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
3
/* { dg-do compile } */
4
/* { dg-options "" } */
5
 
6
struct s0 {
7
  struct s0 { int a; } x; /* { dg-error "error: nested redefinition of 'struct s0'" } */
8
};
9
 
10
struct s1 {
11
  const struct s1 { int b; } x; /* { dg-error "error: nested redefinition of 'struct s1'" } */
12
};
13
 
14
struct s2 {
15
  struct s2 { int c; } *x; /* { dg-error "error: nested redefinition of 'struct s2'" } */
16
};
17
 
18
struct s3 {
19
  struct s4 {
20
    struct s5 {
21
      struct s3 { int a; } **x; /* { dg-error "error: nested redefinition of 'struct s3'" } */
22
    } y;
23
  } z;
24
};
25
 
26
struct s6;
27
struct s6 { struct s6 *p; };
28
 
29
union u0 {
30
  union u0 { int c; } *x; /* { dg-error "error: nested redefinition of 'union u0'" } */
31
};
32
 
33
enum e0 {
34
  E0 = sizeof(enum e0 { E1 }) /* { dg-error "error: nested redefinition of 'enum e0'" } */
35
};
36
 
37
enum e1 {
38
  E2 = sizeof(enum e2 { E2 }), /* { dg-error "error: redeclaration of enumerator 'E2'" } */
39
  /* { dg-error "previous definition" "previous E2" { target *-*-* } 38 } */
40
  E3
41
};
42
 
43
enum e3;
44
enum e3 { E4 = 0 };

powered by: WebSVN 2.1.0

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