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]

c++/1038: Sorry, don't know what to type in here.....



>Number:         1038
>Category:       c++
>Synopsis:       Sorry, don't know what to type in here.....
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 11 07:46:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     sdr@home.ins.de
>Release:        mingw: 2.95.2 19991024, cygwin: 2.7-B19 2.7-97r2aBeta
>Organization:
>Environment:
Windows NT (mingw or cygwin), Windows shell cmd.exe
or bash.exe
>Description:
"Internal Compiler Error" with following code (no further
messages from GCC):

struct Test {
  Test(const char *aString = 0);
  Test &set(const Test &arg = Test());
};

compiled with command "g++ test.cpp" and also with some
other compiler switches.
Works also if Test is a class.
>How-To-Repeat:

>Fix:

1.) Don't use default arg of Test::Test() within set():

struct Test {
  Test(const char *aString = 0);
  Test &set(const Test &arg = Test( "" /* <<< */ ));
};

2.) Define a real default constructor:

struct Test {
  Test()
  Test(const char *aString = 0);
  Test &set(const Test &arg = Test());
};
>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]