This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17082] New: Erroneous error message when using arrays in double constructor
- From: "claus dot tondering at teknologisk dot dk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Aug 2004 12:59:23 -0000
- Subject: [Bug c++/17082] New: Erroneous error message when using arrays in double constructor
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code cannot be compiled with g++.
g++ prints this error message for the the declartion of s1:
error: syntax error before `,' token
Switching the arguments arr[0] and 3 causes the error message to go away.
Error seen on a Cygwin system running g++ version 3.3.1 and on a GNU/Linux
system running g++ version 3.2.2.
-----------------------------------------------------------
class A {
public:
A(int i, int j);
};
class B {
public:
B(A n);
};
int arr[10];
void func()
{
B s1( A(arr[0], 3) );
}
--
Summary: Erroneous error message when using arrays in double
constructor
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: claus dot tondering at teknologisk dot dk
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17082