diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.robertl/eb97.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.robertl/eb97.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C new file mode 100644 index 000000000..e273dab5d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C @@ -0,0 +1,25 @@ +// { dg-do run } +// 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); +} |