This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/10497: Bug #909 not closed : Spurious error using nested classes in constructor calls
- From: have at ann dot jussieu dot fr
- To: gcc-gnats at gcc dot gnu dot org
- Date: 25 Apr 2003 13:17:10 -0000
- Subject: c++/10497: Bug #909 not closed : Spurious error using nested classes in constructor calls
- Reply-to: have at ann dot jussieu dot fr
>Number: 10497
>Category: c++
>Synopsis: Bug #909 not closed : Spurious error using nested classes in constructor calls
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Apr 25 13:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: have at ann dot jussieu dot fr
>Release: 2.95, 3.0, 3.2, 3.3
>Organization:
>Environment:
Linux
>Description:
Bug #909 does not seem to be fixed even if it is closed.
With g++ > 3.0, the error becomes:
" error: type specifier omitted for parameter `Z' "
>How-To-Repeat:
// Just compile this code
class A {
public:
struct Nested { Nested(int i) {} };
A(const Nested &n, int *p=0) { }
};
class B {
public:
B(const A::Nested &n, int *p=0) { }
B(const A &a, int *p=0) { }
};
int main(void)
{
int *Z=0;
int i=1;
A a(A::Nested(i), Z); // ERROR: type specifier omitted for parameter
A b(A::Nested(int(i)), Z); // ERROR: type specifier omitted for parameter
A c(A::Nested((int)i), Z); // OK
A d(A::Nested(1), Z); // OK
A e(A::Nested(i)); // OK
A f(i, Z); // OK
B g(A::Nested(i), Z); // ERROR: type specifier omitted for parameter
B h(i, Z); // OK
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: