diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.ext/pretty.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.ext/pretty.C | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty.C new file mode 100644 index 00000000000..d7951324c62 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty.C @@ -0,0 +1,43 @@ +// Test for PRETTY_FUNCTION +// Build don't link: + +class SV; + +class SVTable // : public Debug +{ + // It is an array to pointer to a SV. + SV ** array; + + // This is the size of array. + int maxCount; + + // This is the current element count. + int count; + + void fatal_error (const char *f, ...); + +public: + SVTable (int size, const char *d); + SVTable (); + SVTable (const SVTable &); + ~SVTable () {} + +}; + + +SVTable::SVTable (int size, const char *d) + : maxCount (size), count (0)// , Debug (d) +{ + if (size < 0) + { + fatal_error (__PRETTY_FUNCTION__ ": Invalid size: %d\n", size); + } + + array = (SV **) new SV * [size]; + + if (array == 0) + { + fatal_error (__PRETTY_FUNCTION__ + ": Failed to allocate array\n"); + } +} |