This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Section 12.1.13A of the Standard & gcc


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
{
public:
    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
fine.

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

m.

-- 
Programmer             "Ha ha." "Ha ha." "What are you laughing at?"
Loki Software                      "Just the horror of being alive."
http://lokigames.com/~briareos/                   - Tony Millionaire

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]