Bug 48255

Summary: default constructor with argument INT
Product: gcc Reporter: Lisp2D <lisp2d>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 4.5.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Lisp2D 2011-03-23 15:43:22 UTC
class A{
public:
};

A x; // OK
A y(1); //OK

I can't found that standard says: default constructor with argument INT.

By code protection I will write:

class A{
A(); // w/o definition
A(int); // w/o definition
public:
};

What to do?
Comment 1 Richard Biener 2011-03-23 15:55:36 UTC
t.C:5:6: error: no matching function for call to ‘A::A(int)’
t.C:1:8: note: candidates are: A::A()
t.C:1:8: note:                 A::A(const A&)

your code example is rejected as it should.
Comment 2 Lisp2D 2011-03-23 16:15:14 UTC
found silent conversion

class A have

explicit A(std::complex<long double>const& x);