Bug#357944: g++-4.0: g++ compiles invalid code for object instantiation like "MyClass obj(obj); "
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)
test.cc:12: error: (Each undeclared identifier is reported only once for
each
function it appears in.)
test.cc:13: error: `a' undeclared (first use this function)
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Versions of packages g++-4.0 depends on:
ii gcc-4.0 4.0.3-1 The GNU C compiler
ii gcc-4.0-base 4.0.3-1 The GNU Compiler Collection (base
ii libc6 2.3.6-3 GNU C Library: Shared libraries an
ii libstdc++6-4.0-dev 4.0.3-1 The GNU Standard C++ Library v3 (d
g++-4.0 recommends no packages.
-- no debconf information
Reply to: