Section 12.1.13A of the Standard & gcc

Michael Vance
Thu Jun 15 14:42:00 GMT 2000

Gcc does not appear to think that A() can promote to type of A&

If this is answered somewhere else, please let me know. I've read the
spec, section 12.1.13A, and the answer is not clear to me. MSVC and
Metrowerks both allow this, but it seems up in the air to me. My
Windows counterparts are dubious of gcc's correct-ness :).

class A
    A( ) { };

void foo( A& a )


int main( int argc, char* argv[] )
    foo( A( ) );   // doesn't work

    return 0;

If foo() is changed to void foo( A a ), the call by value works just

Any information is appreciated, as well as a private Cc:.


Programmer             "Ha ha." "Ha ha." "What are you laughing at?"
Loki Software                      "Just the horror of being alive."                   - Tony Millionaire

More information about the Gcc-bugs mailing list