diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2003-01-01 15:43:19 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2003-01-01 15:43:19 +0000 |
commit | 0ba7ab3e316b1e9ef9ddf37accabc03440e18765 (patch) | |
tree | d1062bcb3fbb2f7c7d94e368f510731f01b59846 | |
parent | 16dfd8d12ae41c2a4de39bac9566a675b95bdd8f (diff) | |
download | gcc-0ba7ab3e316b1e9ef9ddf37accabc03440e18765.zip gcc-0ba7ab3e316b1e9ef9ddf37accabc03440e18765.tar.gz gcc-0ba7ab3e316b1e9ef9ddf37accabc03440e18765.tar.bz2 |
* g++.dg/parse/parse5.C: New test.
From-SVN: r60750
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/parse5.C | 33 |
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7bbfb29..2a9f3f7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-01-01 Neil Booth <neil@daikokuya.co.uk> + + * g++.dg/parse/parse5.C: New test. + 2003-01-01 Nathanael Nerode <neroden@gcc.gnu.org> * g++.dg/parse/parens1.C: New test. diff --git a/gcc/testsuite/g++.dg/parse/parse5.C b/gcc/testsuite/g++.dg/parse/parse5.C new file mode 100644 index 0000000..d3e015a --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/parse5.C @@ -0,0 +1,33 @@ +/* PR c++/590 */ +/* { dg-do compile } */ + +#include <iostream> +#include <sstream> +using namespace std; + +enum ExternalEnum { EXTERNAL_VALUE = 2 }; + +class BadStream : public ostringstream +{ +public: + enum InternalEnum { VALUE = 0 }; + BadStream( InternalEnum e ) {}; + BadStream( InternalEnum e, int i ) {}; +}; + +int main() +{ + ( BadStream( BadStream::VALUE ) ) << "foobar" << endl; + + BadStream((BadStream::InternalEnum)BadStream::VALUE ) << "foobar"; + + BadStream::InternalEnum in = BadStream::VALUE; + BadStream( in ) << "foobar"; + + BadStream( BadStream::VALUE, 0 ) << "foobar" << endl; + + // This didn't used to compile: + BadStream( BadStream::VALUE ) << "foobar" << endl; + + return 0; +} |