Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

gcc error "treated as compound expression", SunCC compiles it.

825897Dec 22 2010 — edited Jan 19 2011
Hi

This sample code compiles with SunCC, though I expected it not to.

/Lars V

#include <iostream>

class test
{
public:
test( int a )
{
}
};

int main()
{
int a( 5 );
int b( 6 );

const test & test_ref( "aaaaa", a, b, test( 1 ) );

const int & c ( "aaaaa", a, b );
std::cout << c << std::endl;
}

Generates the result: 6
This post has been answered by Steve.Clamage-Oracle on Dec 22 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2011
Added on Dec 22 2010
4 comments
324 views