URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do assemble }
|
// { dg-do assemble }
|
|
|
template
|
template
|
void f(T) {}
|
void f(T) {}
|
|
|
template
|
template
|
struct S {
|
struct S {
|
static T t;
|
static T t;
|
};
|
};
|
|
|
template
|
template
|
T S::t;
|
T S::t;
|
|
|
template void f(int);
|
template void f(int);
|
template void f(int); // { dg-error "duplicate explicit instantiation" }
|
template void f(int); // { dg-error "duplicate explicit instantiation" }
|
template int S::t;
|
template int S::t;
|
template int S::t; // { dg-error "duplicate explicit instantiation" }
|
template int S::t; // { dg-error "duplicate explicit instantiation" }
|
template class S;
|
template class S;
|
template class S; // { dg-error "duplicate explicit instantiation" }
|
template class S; // { dg-error "duplicate explicit instantiation" }
|
|
|
extern template void f(double); // { dg-error "extern" } extern not allowed
|
extern template void f(double); // { dg-error "extern" } extern not allowed
|
inline template class S; // { dg-error "inline" } inline not allowed
|
inline template class S; // { dg-error "inline" } inline not allowed
|
|
|
template
|
template
|
struct S {};
|
struct S {};
|
|
|
template class S; // OK - explicit instantiation of partial
|
template class S; // OK - explicit instantiation of partial
|
// specialization
|
// specialization
|
|
|
template <>
|
template <>
|
struct S {};
|
struct S {};
|
|
|
template class S; // OK - explicit instantiation after
|
template class S; // OK - explicit instantiation after
|
|
|
template <>
|
template <>
|
void f(long double) {}
|
void f(long double) {}
|
|
|
template void f(long double); // OK - explicit instantiation after
|
template void f(long double); // OK - explicit instantiation after
|
|
|
template
|
template
|
void g(T);
|
void g(T);
|
|
|
template void g(int); // { dg-error "no definition available" "no def" }
|
template void g(int); // { dg-error "no definition available" "no def" }
|
// { dg-message "instantiated" "inst" { target *-*-* } 43 }
|
// { dg-message "instantiated" "inst" { target *-*-* } 43 }
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.