This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17082] New: Erroneous error message when using arrays in double constructor


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]