URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// { dg-do compile }
|
// { dg-do compile }
|
// { dg-options "-Wall" }
|
// { dg-options "-Wall" }
|
|
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Contributed by Nathan Sidwell 2 Sep 2003
|
// Contributed by Nathan Sidwell 2 Sep 2003
|
|
|
// PR 12037.
|
// PR 12037.
|
|
|
struct X
|
struct X
|
{
|
{
|
int operator+(int);
|
int operator+(int);
|
int operator-(int);
|
int operator-(int);
|
int operator*(int);
|
int operator*(int);
|
int operator/(int);
|
int operator/(int);
|
int operator%(int);
|
int operator%(int);
|
int operator>>(int);
|
int operator>>(int);
|
int operator<<(int);
|
int operator<<(int);
|
int operator&(int);
|
int operator&(int);
|
int operator|(int);
|
int operator|(int);
|
int operator^(int);
|
int operator^(int);
|
int operator&&(int);
|
int operator&&(int);
|
int operator||(int);
|
int operator||(int);
|
int operator==(int);
|
int operator==(int);
|
int operator!=(int);
|
int operator!=(int);
|
int operator<(int);
|
int operator<(int);
|
int operator<=(int);
|
int operator<=(int);
|
int operator>(int);
|
int operator>(int);
|
int operator>=(int);
|
int operator>=(int);
|
int operator*();
|
int operator*();
|
int operator!();
|
int operator!();
|
int operator~();
|
int operator~();
|
int operator++();
|
int operator++();
|
int operator--();
|
int operator--();
|
int operator++(int);
|
int operator++(int);
|
int operator--(int);
|
int operator--(int);
|
int operator()();
|
int operator()();
|
int operator,(int);
|
int operator,(int);
|
X *operator->();
|
X *operator->();
|
operator int () const;
|
operator int () const;
|
int m;
|
int m;
|
virtual ~X ();
|
virtual ~X ();
|
X &Foo ();
|
X &Foo ();
|
};
|
};
|
struct Y : X
|
struct Y : X
|
{
|
{
|
};
|
};
|
|
|
template void Foo (X &x)
|
template void Foo (X &x)
|
{
|
{
|
x + I;
|
x + I;
|
x - I;
|
x - I;
|
x * I;
|
x * I;
|
x / I;
|
x / I;
|
x % I;
|
x % I;
|
x >> I;
|
x >> I;
|
x << I;
|
x << I;
|
x & I;
|
x & I;
|
x | I;
|
x | I;
|
x && I;
|
x && I;
|
x || I;
|
x || I;
|
x == I;
|
x == I;
|
x != I;
|
x != I;
|
x < I;
|
x < I;
|
x <= I;
|
x <= I;
|
x > I;
|
x > I;
|
x >= I;
|
x >= I;
|
*x;
|
*x;
|
!x;
|
!x;
|
~x;
|
~x;
|
x++;
|
x++;
|
x--;
|
x--;
|
++x;
|
++x;
|
--x;
|
--x;
|
x ();
|
x ();
|
x, I;
|
x, I;
|
x->m;
|
x->m;
|
static_cast (x);
|
static_cast (x);
|
dynamic_cast (x);
|
dynamic_cast (x);
|
reinterpret_cast (x.Foo ()); // { dg-error "invalid cast" }
|
reinterpret_cast (x.Foo ()); // { dg-error "invalid cast" }
|
const_cast (x.Foo ()); // { dg-warning "not used" }
|
const_cast (x.Foo ()); // { dg-warning "not used" }
|
|
|
reinterpret_cast (&x);// { dg-warning "no effect" "" }
|
reinterpret_cast (&x);// { dg-warning "no effect" "" }
|
const_cast (x); // { dg-warning "no effect" "" }
|
const_cast (x); // { dg-warning "no effect" "" }
|
sizeof (x++); // { dg-warning "no effect" "" }
|
sizeof (x++); // { dg-warning "no effect" "" }
|
__alignof__ (x++); // { dg-warning "no effect" "" }
|
__alignof__ (x++); // { dg-warning "no effect" "" }
|
}
|
}
|
|
|
template void Foo<4> (X&); // { dg-message "instantiated" }
|
template void Foo<4> (X&); // { dg-message "instantiated" }
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.