File: Wcxx-compat-10.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (73 lines) | stat: -rw-r--r-- 1,670 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* { dg-do compile } */
/* { dg-options "-Wc++-compat" } */

struct s1 { int f; };
typedef int s2;
void
f1 ()
{
  typedef int s1;
  struct s2 { int f; };
}

struct s3 { int f; };
typedef struct s3 s3;

typedef struct s4 s4;
struct s4 { int f; };

struct s5 { int f; };	/* { dg-message "note: originally defined here" } */
typedef int s5;		/* { dg-warning "invalid in C\[+\]\[+\]" } */

typedef int s6;		/* { dg-message "note: originally defined here" } */
struct s6 { int f; };	/* { dg-warning "invalid in C\[+\]\[+\]" } */

void
f2 ()
{
  struct s7 { int f; };	/* { dg-message "note: originally defined here" } */
  typedef int s7;	/* { dg-warning "invalid in C\[+\]\[+\]" } */

  typedef int s8;	/* { dg-message "note: originally defined here" } */
  struct s8 { int f; };	/* { dg-warning "invalid in C\[+\]\[+\]" } */

  struct s9 { int f; };
  { typedef int s9; }

  typedef int s10;
  { struct s10 { int f; }; }
}

enum e1 { A };
typedef int e2;
void
f3 ()
{
  typedef int e1;
  enum e2 { B };
}

enum e3 { C };
typedef enum e3 e3;

enum e5 { E };		/* { dg-message "note: originally defined here" } */
typedef int e5;		/* { dg-warning "invalid in C\[+\]\[+\]" } */

typedef int e6;		/* { dg-message "note: originally defined here" } */
enum e6 { F };		/* { dg-warning "invalid in C\[+\]\[+\]" } */

void
f4 ()
{
  enum e7 { G };	/* { dg-message "note: originally defined here" } */
  typedef int e7;	/* { dg-warning "invalid in C\[+\]\[+\]" } */

  typedef int e8;	/* { dg-message "note: originally defined here" } */
  enum e8 { H };	/* { dg-warning "invalid in C\[+\]\[+\]" } */

  enum e9 { I };
  { typedef int e9; }

  typedef int e10;
  { enum e10 { J }; }
}