public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8860: illegal constructor causes internal compiler error
@ 2002-12-07  8:16 a-hw
  0 siblings, 0 replies; 3+ messages in thread
From: a-hw @ 2002-12-07  8:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8860
>Category:       c++
>Synopsis:       illegal constructor causes internal compiler error
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 07 08:16:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     a-hw@mail.ru
>Release:        gcc (GCC) 3.2 (mingw special 20020817-1)
>Organization:
>Environment:
Win2K, MingGW 2.0.0 prebuilt binaries
>Description:
This code causes g++ to feel segmentation fault. I've replaced initializer for base class Smoother(size) with Smoother_Lookup(size):

template<typename Function>
class Smoother_Lookup : public Smoother {
public:
	Smoother_Lookup(int size) : Smoother_Lookup(size), lookup(size) {
		std::generate_n(lookup.begin(), size, Function(size));
	}
	int smooth(int r) { return lookup[r]; }
protected:
	std::vector<int> lookup;
};
>How-To-Repeat:
Try to compile test.cpp:

make test.o
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="test.cpp"
Content-Disposition: inline; filename="test.cpp"

#include <vector>

class Smoother {
public:
	Smoother(int size) : _size(size) { }
	virtual ~Smoother() = 0;
	virtual int smooth(int r) = 0;
protected:
	int _size;
};

template<typename Function>
class Smoother_Lookup : public Smoother {
public:
	Smoother_Lookup(int size) : Smoother_Lookup(size), lookup(size) {
		std::generate_n(lookup.begin(), size, Function(size));
	}
	int smooth(int r) { return lookup[r]; }
protected:
	std::vector<int> lookup;
};

struct Test {
	int operator()() { return 0; }
};

int
f() {
	Smoother_Lookup<Test> sl(1);
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: c++/8860: illegal constructor causes internal compiler error
@ 2002-12-08  6:46 Alex Kunin
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Kunin @ 2002-12-08  6:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/8860; it has been noted by GNATS.

From: Alex Kunin <AlexK@aldec.katowice.pl>
To: "'reichelt@igpm.rwth-aachen.de'" <reichelt@igpm.rwth-aachen.de>, 
	"'a-hw@mail.ru'" <a-hw@mail.ru>, "'gcc-bugs@gcc.gnu.org'"
	 <gcc-bugs@gcc.gnu.org>, "'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>, 
	"'nobody@gcc.gnu.org'" <nobody@gcc.gnu.org>, "'gcc-gnats@gcc.gnu.org'"
	 <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: RE: c++/8860: illegal constructor causes internal compiler error
Date: Sun, 8 Dec 2002 15:40:18 +0100 

 This message is in MIME format. Since your mail reader does not understand
 this format, some or all of this message may not be legible.
 
 ------_=_NextPart_001_01C29EC7.BA9FA3A0
 Content-Type: text/plain;
 	charset="koi8-r"
 
 Thank you. :-)
 
 > -----Original Message-----
 > From: reichelt@igpm.rwth-aachen.de 
 > [mailto:reichelt@igpm.rwth-aachen.de]
 > Sent: Saturday, December 07, 2002 10:21 PM
 > To: a-hw@mail.ru; gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org;
 > nobody@gcc.gnu.org
 > Subject: Re: c++/8860: illegal constructor causes internal compiler
 > error
 > 
 > 
 > Synopsis: illegal constructor causes internal compiler error
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: reichelt
 > State-Changed-When: Sat Dec  7 13:21:20 2002
 > State-Changed-Why:
 >     Fixed in gcc 3.2.1.
 >     gcc 3.2.1 and mainline report:
 >     
 >     test.cpp: In constructor 
 > `Smoother_Lookup<Function>::Smoother_Lookup(int) [with 
 >        Function = Test]':
 >     test.cpp:29:   instantiated from here
 >     test.cpp:15: type `class Smoother_Lookup<Test>' is not a 
 > direct base of `
 >        Smoother_Lookup<Test>'
 >     test.cpp:15: no matching function for call to 
 > `Smoother::Smoother()'
 >     test.cpp:3: candidates are: Smoother::Smoother(const Smoother&)
 >     test.cpp:5:                 Smoother::Smoother(int)
 >     test.cpp:29:   instantiated from here
 >     test.cpp:16: no matching function for call to `Test::Test(int&)'
 >     test.cpp:23: candidates are: Test::Test()
 >     test.cpp:23:                 Test::Test(const Test&)
 >     test.cpp:16: `generate_n' undeclared in namespace `std'
 >     
 >     I checked this on i686-pc-linux-gnu, but since I could 
 > reproduce the problem
 >     with gcc 3.2 on this platform, I assume it is fixed also 
 > for the submitters
 >     platform.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&
 database=gcc&pr=8860
 
 
 ------_=_NextPart_001_01C29EC7.BA9FA3A0
 Content-Type: text/html;
 	charset="koi8-r"
 Content-Transfer-Encoding: quoted-printable
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
 <HTML>
 <HEAD>
 <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
 charset=3Dkoi8-r">
 <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
 5.5.2653.12">
 <TITLE>RE: c++/8860: illegal constructor causes internal compiler =
 error</TITLE>
 </HEAD>
 <BODY>
 
 <P><FONT SIZE=3D2>Thank you. :-)</FONT>
 </P>
 
 <P><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
 <BR><FONT SIZE=3D2>&gt; From: reichelt@igpm.rwth-aachen.de </FONT>
 <BR><FONT SIZE=3D2>&gt; [<A =
 HREF=3D"mailto:reichelt@igpm.rwth-aachen.de">mailto:reichelt@igpm.rwth-a=
 achen.de</A>]</FONT>
 <BR><FONT SIZE=3D2>&gt; Sent: Saturday, December 07, 2002 10:21 =
 PM</FONT>
 <BR><FONT SIZE=3D2>&gt; To: a-hw@mail.ru; gcc-bugs@gcc.gnu.org; =
 gcc-prs@gcc.gnu.org;</FONT>
 <BR><FONT SIZE=3D2>&gt; nobody@gcc.gnu.org</FONT>
 <BR><FONT SIZE=3D2>&gt; Subject: Re: c++/8860: illegal constructor =
 causes internal compiler</FONT>
 <BR><FONT SIZE=3D2>&gt; error</FONT>
 <BR><FONT SIZE=3D2>&gt; </FONT>
 <BR><FONT SIZE=3D2>&gt; </FONT>
 <BR><FONT SIZE=3D2>&gt; Synopsis: illegal constructor causes internal =
 compiler error</FONT>
 <BR><FONT SIZE=3D2>&gt; </FONT>
 <BR><FONT SIZE=3D2>&gt; State-Changed-From-To: open-&gt;closed</FONT>
 <BR><FONT SIZE=3D2>&gt; State-Changed-By: reichelt</FONT>
 <BR><FONT SIZE=3D2>&gt; State-Changed-When: Sat Dec&nbsp; 7 13:21:20 =
 2002</FONT>
 <BR><FONT SIZE=3D2>&gt; State-Changed-Why:</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Fixed in gcc =
 3.2.1.</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; gcc 3.2.1 and mainline =
 report:</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; test.cpp: In =
 constructor </FONT>
 <BR><FONT SIZE=3D2>&gt; =
 `Smoother_Lookup&lt;Function&gt;::Smoother_Lookup(int) [with </FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
 Function =3D Test]':</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
 test.cpp:29:&nbsp;&nbsp; instantiated from here</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; test.cpp:15: type =
 `class Smoother_Lookup&lt;Test&gt;' is not a </FONT>
 <BR><FONT SIZE=3D2>&gt; direct base of `</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
 Smoother_Lookup&lt;Test&gt;'</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; test.cpp:15: no =
 matching function for call to </FONT>
 <BR><FONT SIZE=3D2>&gt; `Smoother::Smoother()'</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; test.cpp:3: candidates =
 are: Smoother::Smoother(const Smoother&amp;)</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
 test.cpp:5:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
 nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Smoother::Smoother(int)</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
 test.cpp:29:&nbsp;&nbsp; instantiated from here</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; test.cpp:16: no =
 matching function for call to `Test::Test(int&amp;)'</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; test.cpp:23: candidates =
 are: Test::Test()</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
 test.cpp:23:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Test::Test(const Test&amp;)</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; test.cpp:16: =
 `generate_n' undeclared in namespace `std'</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I checked this on =
 i686-pc-linux-gnu, but since I could </FONT>
 <BR><FONT SIZE=3D2>&gt; reproduce the problem</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; with gcc 3.2 on this =
 platform, I assume it is fixed also </FONT>
 <BR><FONT SIZE=3D2>&gt; for the submitters</FONT>
 <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; platform.</FONT>
 <BR><FONT SIZE=3D2>&gt; </FONT>
 <BR><FONT SIZE=3D2>&gt; <A =
 HREF=3D"http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&=
 " =
 TARGET=3D"_blank">http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20au=
 dit-trail&</A></FONT>
 <BR><FONT SIZE=3D2>database=3Dgcc&amp;pr=3D8860</FONT>
 </P>
 
 </BODY>
 </HTML>
 ------_=_NextPart_001_01C29EC7.BA9FA3A0--


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/8860: illegal constructor causes internal compiler error
@ 2002-12-07 13:21 reichelt
  0 siblings, 0 replies; 3+ messages in thread
From: reichelt @ 2002-12-07 13:21 UTC (permalink / raw)
  To: a-hw, gcc-bugs, gcc-prs, nobody

Synopsis: illegal constructor causes internal compiler error

State-Changed-From-To: open->closed
State-Changed-By: reichelt
State-Changed-When: Sat Dec  7 13:21:20 2002
State-Changed-Why:
    Fixed in gcc 3.2.1.
    gcc 3.2.1 and mainline report:
    
    test.cpp: In constructor `Smoother_Lookup<Function>::Smoother_Lookup(int) [with 
       Function = Test]':
    test.cpp:29:   instantiated from here
    test.cpp:15: type `class Smoother_Lookup<Test>' is not a direct base of `
       Smoother_Lookup<Test>'
    test.cpp:15: no matching function for call to `Smoother::Smoother()'
    test.cpp:3: candidates are: Smoother::Smoother(const Smoother&)
    test.cpp:5:                 Smoother::Smoother(int)
    test.cpp:29:   instantiated from here
    test.cpp:16: no matching function for call to `Test::Test(int&)'
    test.cpp:23: candidates are: Test::Test()
    test.cpp:23:                 Test::Test(const Test&)
    test.cpp:16: `generate_n' undeclared in namespace `std'
    
    I checked this on i686-pc-linux-gnu, but since I could reproduce the problem
    with gcc 3.2 on this platform, I assume it is fixed also for the submitters
    platform.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8860


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-08 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-07  8:16 c++/8860: illegal constructor causes internal compiler error a-hw
2002-12-07 13:21 reichelt
2002-12-08  6:46 Alex Kunin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).