This is the mail archive of the 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++/8053: don't called copy constructor

>Number:         8053
>Category:       c++
>Synopsis:       don't called copy constructor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 25 21:46:00 PDT 2002
>Release:        gcc 3.0.2
$ uname -a
SunOS host 5.6 Generic_105181-29 sun4u sparc SUNW,Ultra-4

$ gcc -v
Reading specs from /usr/local/gcc302/lib/gcc-lib/sparc-sun-solaris2.6/3.0.2/specs
Configured with: ./configure --prefix=/usr/local/gcc302 --enable-languages=c,c++ --enable-threads=posix
Thread model: posix
gcc version 3.0.2
There is no copy constructor call after calling c1(int) constructor in the statement c=c1(100).
#include <stdio.h>

class c1 {
  c1(const c1& c) {
    fprintf(stderr,"call c1(const c1&)\n");
  c1(int aa) {
    fprintf(stderr,"call c1(int)\n");

int main()
  c1 c=c1(10);


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