Bug#357944: g++-4.0: g++ compiles invalid code for object instantiation like "MyClass obj(obj); "
Michael Weitzel <weitzel@ldknet.org> writes:
> Package: g++-4.0
> Version: 4.0.3-1
> Severity: normal
>
> g++ compiles the following wrong C++ code without complaining:
>
> #include <complex>
> class A {
> public:
> A() {}
> };
>
> int main()
> {
> std::complex<double> bla(bla);
> A blubb(blubb);
> }
>
> This bug also affects g++-3.4. g++-3.3 correctly complaints:
>
> test.cc: In function `int main()':
> test.cc:12: error: `bla' undeclared (first use this function)
Why do you think g++-3.3 is correct? Looks rather like a bug in 3.3 to
me.
--
Falk
Reply to: