URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
// { dg-do run }
|
// { dg-do run }
|
|
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Contributed by Nathan Sidwell 22 Jul 2003
|
// Contributed by Nathan Sidwell 22 Jul 2003
|
|
|
// PR 9447. Using decls in template classes.
|
// PR 9447. Using decls in template classes.
|
|
|
template
|
template
|
struct Foo {
|
struct Foo {
|
int i (int) {return 1;}
|
int i (int) {return 1;}
|
};
|
};
|
|
|
struct Baz
|
struct Baz
|
{
|
{
|
int k (int) {return 2;}
|
int k (int) {return 2;}
|
};
|
};
|
|
|
template
|
template
|
struct Bar : public Foo , Baz {
|
struct Bar : public Foo , Baz {
|
using Foo::i;
|
using Foo::i;
|
using Baz::k;
|
using Baz::k;
|
|
|
int i (float) {return 3;}
|
int i (float) {return 3;}
|
int k (float) {return 3;}
|
int k (float) {return 3;}
|
|
|
int foo()
|
int foo()
|
{
|
{
|
if (i (1) != 1)
|
if (i (1) != 1)
|
return 1;
|
return 1;
|
if (k (1) != 2)
|
if (k (1) != 2)
|
return 2;
|
return 2;
|
|
|
return 0;
|
return 0;
|
}
|
}
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
Bar bar;
|
Bar bar;
|
|
|
return bar.foo();
|
return bar.foo();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.