2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / g++.dg / parse / parse5.C
blobf9e6a035984707d667d59515f9d5e0f082103bc7
1 /* PR c++/590 */
2 /* { dg-do compile } */
4 #include <iostream>
5 #include <sstream>
6 using namespace std;
8 enum ExternalEnum { EXTERNAL_VALUE = 2 };
10 class BadStream : public ostringstream 
11 {    
12 public: 
13   enum InternalEnum { VALUE = 0 };   
14   BadStream( InternalEnum e ) {}
15   BadStream( InternalEnum e, int i ) {}
18 int main() 
20   ( BadStream( BadStream::VALUE ) ) << "foobar" << endl;
22   BadStream((BadStream::InternalEnum)BadStream::VALUE ) << "foobar";
24   BadStream::InternalEnum in = BadStream::VALUE;
25   BadStream( in ) << "foobar";
26     
27   BadStream( BadStream::VALUE, 0 ) << "foobar" << endl;
28     
29   // This didn't used to compile:
30   BadStream( BadStream::VALUE ) << "foobar" << endl;
32   return 0;