| 1 |
// { dg-do run } |
| 2 |
// Creates bad assembly on sparc and x86 |
| 3 |
template<unsigned long SIZE> |
| 4 |
struct Array { }; |
| 5 |
|
| 6 |
template<unsigned long SIZE> |
| 7 |
Array<SIZE> test_ok(const Array<SIZE>& a) { |
| 8 |
Array<SIZE> result; |
| 9 |
return(result); |
| 10 |
} |
| 11 |
|
| 12 |
template<unsigned long SIZE> |
| 13 |
Array<SIZE + 1> test_error(const Array<SIZE>& a) { |
| 14 |
Array<SIZE + 1> result; |
| 15 |
return(result); |
| 16 |
} |
| 17 |
|
| 18 |
int main(int argc, char* argv[]) { |
| 19 |
Array<2> a; |
| 20 |
|
| 21 |
test_ok(a); |
| 22 |
test_error(a); // <<< MARKED LINE! |
| 23 |
|
| 24 |
return(0); |
| 25 |
} |