OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [Wcxx-compat-8.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wc++-compat" } */
3
 
4
struct s1
5
{
6
  enum e1       /* { dg-message "note: enum type defined here" } */
7
  {
8
    A = sizeof (struct s2 { int i; }),  /* { dg-warning "invalid in C\[+\]\[+\]" } */
9
    B
10
  } f1;
11
};
12
struct s2 v1;   /* Don't issue another warning about s2.  */
13
enum e1 v2;     /* { dg-warning "not visible in C\[+\]\[+\]" } */
14
 
15
enum e2
16
{
17
  C = sizeof (struct s3 { int i; }),    /* { dg-warning "invalid in C\[+\]\[+\]" } */
18
  D = __alignof__ (struct s4 { int i; }), /* { dg-warning "invalid in C\[+\]\[+\]" } */
19
  E
20
};
21
 
22
struct s3 v3;
23
int v4 = C;
24
 
25
__typeof__ (struct s5 { int i; }) v5; /* { dg-warning "invalid in C\[+\]\[+\]" } */
26
 
27
int
28
f1 (struct s1 *p)
29
{
30
  return ((struct s6 { int j; } *) p)->j;  /* { dg-warning "invalid in C\[+\]\[+\]" } */
31
}
32
 
33
int
34
f2 (struct s1 *p)
35
{
36
  return (__extension__ (struct s7 { int j; } *)p)->j;
37
}
38
 
39
int
40
f3 ()
41
{
42
  return (struct s8 { int i; }) { 0 }.i;  /* { dg-warning "invalid in C\[+\]\[+\]" } */
43
}

powered by: WebSVN 2.1.0

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