URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 519 |
// { dg-do assemble }
|
// { dg-do assemble }
|
|
|
// Copyright (C) 1999 Free Software Foundation
|
// Copyright (C) 1999 Free Software Foundation
|
|
|
// by Alexandre Oliva
|
// by Alexandre Oliva
|
|
|
template void foo(T);
|
template void foo(T);
|
template void foo(T*);
|
template void foo(T*);
|
|
|
template class bar {
|
template class bar {
|
private:
|
private:
|
int i; // { dg-error "" } this variable
|
int i; // { dg-error "" } this variable
|
friend void foo(T);
|
friend void foo(T);
|
};
|
};
|
|
|
template void foo(T) {
|
template void foo(T) {
|
bar().i = 0; // ok, I'm a friend
|
bar().i = 0; // ok, I'm a friend
|
}
|
}
|
template void foo(T*) {
|
template void foo(T*) {
|
bar().i = 1; // { dg-error "" } not a friend
|
bar().i = 1; // { dg-error "" } not a friend
|
}
|
}
|
|
|
int main() {
|
int main() {
|
int j = 0;
|
int j = 0;
|
foo(j); // calls foo(int), ok
|
foo(j); // calls foo(int), ok
|
foo(&j); // calls foo(int*)
|
foo(&j); // calls foo(int*)
|
foo(&j); // calls foo(int*), ok
|
foo(&j); // calls foo(int*), ok
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.