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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wstrict-aliasing-bogus-base-derived.C] - Blame information for rev 715

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
3
 
4
 
5
class base {
6
 public:
7
  int x;
8
};
9
 
10
class derived: public base {
11
 public:
12
  int y;
13
};
14
 
15
base foo () {
16
  derived d;
17
  base* pb = &d;  /* { dg-bogus "base vs. derived" } */
18
  pb->x = 1;
19
 
20
  return d;
21
}

powered by: WebSVN 2.1.0

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