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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [cast5.C] - Blame information for rev 305

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

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
 
3
// Copyright (C) 2000 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 4 Feb 2000 
5
 
6
// Array of cv T decays to pointer to cv T, and pointer to array of cv T can
7
// be converted to pointer to cv T. We need to make sure the `cv's don't
8
// confuse us.
9
 
10
typedef char const *ary_t[2];
11
 
12
void f0 (ary_t const *const &ary)
13
{
14
  static_cast  (ary);
15
  static_cast  (ary);         // { dg-error "" } casts away const
16
  (void const *) (ary);
17
}
18
 
19
void f1 (ary_t *const &ary)
20
{
21
  static_cast  (ary);
22
  static_cast  (ary);
23
  (void const *) (ary);
24
}
25
 
26
void f2 (ary_t const *&ary)
27
{
28
  static_cast  (ary);
29
  static_cast  (ary);         // { dg-error "" } casts away const
30
  (void const *) (ary);
31
}
32
 
33
void f3 (ary_t *&ary)
34
{
35
  static_cast  (ary);
36
  static_cast  (ary);
37
  (void const *) (ary);
38
}

powered by: WebSVN 2.1.0

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