This is the mail archive of the gcc-prs@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]

c++/6486: Failure creating a default copy contructor



>Number:         6486
>Category:       c++
>Synopsis:       Failure creating a default copy contructor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 27 05:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Kunert
>Release:        gcc 3.2 20020426
>Organization:
>Environment:
/opt/bin/g++-32 -v
Reading specs from /opt/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../gcc/configure i686-pc-linux-gnu --enable-shared --prefix=/opt --enable-languages=c,c++,f77
Thread model: single
gcc version 3.2 20020426 (experimental)
>Description:
The following code is being rejected. 
This is a regression wrt 3.0 and 3.1.

class A {
public:
    A(){}
    A( const A& a ){}
};

class B  : public A
{
public:
  B( int& s) : s_(s){}
  int& s_;
};

int main()
{
  int i;
  B x1( i );
  B x2( x1 );
}

$ /opt/bin/g++-32 x4.cc
x4.cc: In copy constructor `B::B(const B&)':
x4.cc:18: `const' qualifiers cannot be applied to `int&'
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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