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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [warn/] [noeffect4.C] - Blame information for rev 318

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

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
// { dg-options "-Wall" }
3
 
4
// Copyright (C) 2003 Free Software Foundation, Inc.
5
// Contributed by Nathan Sidwell 2 Sep 2003 
6
 
7
// PR 12037.
8
 
9
struct X
10
{
11
  int operator+(int);
12
  int operator-(int);
13
  int operator*(int);
14
  int operator/(int);
15
  int operator%(int);
16
  int operator>>(int);
17
  int operator<<(int);
18
  int operator&(int);
19
  int operator|(int);
20
  int operator^(int);
21
  int operator&&(int);
22
  int operator||(int);
23
  int operator==(int);
24
  int operator!=(int);
25
  int operator<(int);
26
  int operator<=(int);
27
  int operator>(int);
28
  int operator>=(int);
29
  int operator*();
30
  int operator!();
31
  int operator~();
32
  int operator++();
33
  int operator--();
34
  int operator++(int);
35
  int operator--(int);
36
  int operator()();
37
  int operator,(int);
38
  X *operator->();
39
  operator int () const;
40
  int m;
41
  virtual ~X ();
42
  X &Foo ();
43
};
44
struct Y : X
45
{
46
};
47
 
48
template void Foo (X &x)
49
{
50
  x + I;
51
  x - I;
52
  x * I;
53
  x / I;
54
  x % I;
55
  x >> I;
56
  x << I;
57
  x & I;
58
  x | I;
59
  x && I;
60
  x || I;
61
  x == I;
62
  x != I;
63
  x < I;
64
  x <= I;
65
  x > I;
66
  x >= I;
67
  *x;
68
  !x;
69
  ~x;
70
  x++;
71
  x--;
72
  ++x;
73
  --x;
74
  x ();
75
  x, I;
76
  x->m;
77
  static_cast (x);
78
  dynamic_cast (x);
79
  reinterpret_cast (x.Foo ()); // { dg-error "invalid cast" }
80
  const_cast (x.Foo ());       // { dg-warning "not used" }
81
 
82
  reinterpret_cast (&x);// { dg-warning "no effect" "" }
83
  const_cast (x);         // { dg-warning "no effect" "" }
84
  sizeof (x++);                // { dg-warning "no effect" "" }
85
  __alignof__ (x++);           // { dg-warning "no effect" "" }
86
}
87
 
88
template void Foo<4> (X&);     // { dg-message "instantiated" }

powered by: WebSVN 2.1.0

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