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