public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9103: problems constructing from temporaries
@ 2003-04-07 14:04 bangerth
  0 siblings, 0 replies; 7+ messages in thread
From: bangerth @ 2003-04-07 14:04 UTC (permalink / raw)
  To: darryl.green, gcc-bugs, gcc-prs, nobody

Synopsis: problems constructing from temporaries

State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Mon Apr  7 14:04:08 2003
State-Changed-Why:
    Fixed in mainline.

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


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

* Re: c++/9103: problems constructing from temporaries
@ 2003-04-07 11:06 Giovanni Bajo
  0 siblings, 0 replies; 7+ messages in thread
From: Giovanni Bajo @ 2003-04-07 11:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<darryl.green@unitab.com.au>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>
Cc: "Wolfgang Bangerth" <bangerth@ices.utexas.edu>
Subject: Re: c++/9103: problems constructing from temporaries
Date: Mon, 7 Apr 2003 13:01:50 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=9103
 
 Reconfirmed with 2.95 -> 3.3 as of today, but it should be tested with 3.4
 as well (since it seems a parser problem) - please bump [date] after that.
 
 Giovanni Bajo
 


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

* Re: c++/9103: problems constructing from temporaries
@ 2003-01-24 16:27 bangerth
  0 siblings, 0 replies; 7+ messages in thread
From: bangerth @ 2003-01-24 16:27 UTC (permalink / raw)
  To: darryl.green, gcc-bugs, gcc-prs, nobody

Synopsis: problems constructing from temporaries

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Jan 24 16:27:49 2003
State-Changed-Why:
    Giovanni and Andrew already analyzed this

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


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

* Re: c++/9103: problems constructing from temporaries
@ 2003-01-24 16:16 Giovanni Bajo
  0 siblings, 0 replies; 7+ messages in thread
From: Giovanni Bajo @ 2003-01-24 16:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<darryl.green@unitab.com.au>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>
Cc:  
Subject: Re: c++/9103: problems constructing from temporaries
Date: Fri, 24 Jan 2003 17:11:38 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=9103
 
 Epurated test case:
 -----------------------
 struct A
 {
     A(const A& ) {}
     A(A* ) {}
     A(  ) {}
 
     void foo(void);
 };
 
 int main()
 {
      A a(A(A(new A())));
      a.foo();
 }
 -----------------------
 ice7.cpp: In function `int main()':
 ice7.cpp:116: request for member `foo' in `a()', which is of non-aggregate
 type
    `A ()()'
 
 This is on GCC 3.2. The above should clearly compile, since the line cannot
 be a function declaration (because of the 'new' in it). GCC seems to be
 confused because of the two temporaries, and you can see that also the
 dumped type is wrong. If you remove one temporary:
 
 A a(A(new A()));
 
 the code compiles correctly.  If you remove the 'new':
 
  A a(A(A(A())));
 
 the code fails as expected, but the error shows there is still some
 confusion:
 
 ice7.cpp:116: request for member `foo' in `a(A (*)(A (*)()))', which is of
    non-aggregate type `A ()(A (*)(A (*)()))'
 
 since it's missing the third function pointer (should be `A ()(A (*)(A (*)(A
 (*)())))'.
 
 For the original poster, I'd suggest using the alternative syntax A a =
 A(whatever), unless the constructors are explicit.
 
 Giovanni Bajo
 


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

* Re: c++/9103: problems constructing from temporaries
@ 2002-12-31 11:46 Andrew Pinski
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Pinski @ 2002-12-31 11:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Andrew Pinski <pinskia@physics.uc.edu>
To: darryl.green@unitab.com.au
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/9103: problems constructing from temporaries
Date: Tue, 31 Dec 2002 14:42:49 -0500

 This is fixed with the new parser on 3.4, it was not fixed when 3.3 was 
 branched though (gcc version 3.3 20021216 (experimental)).
 
 Thanks,
 Andrew Pinski
 


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

* Re: c++/9103: problems constructing from temporaries
@ 2002-12-30 18:56 Darryl Green
  0 siblings, 0 replies; 7+ messages in thread
From: Darryl Green @ 2002-12-30 18:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: "Darryl Green" <Darryl.Green@tabq.com.au>
To: "Darryl Green" <Darryl.Green@tabq.com.au>,
	<gcc-gnats@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>
Cc:  
Subject: Re: c++/9103: problems constructing from temporaries
Date: Tue, 31 Dec 2002 12:51:32 +1000

 This is a multi-part message in MIME format.
 
 ------_=_NextPart_001_01C2B077.865CD791
 Content-Type: multipart/alternative;
 	boundary="----_=_NextPart_002_01C2B077.865CD791"
 
 
 ------_=_NextPart_002_01C2B077.865CD791
 Content-Type: text/plain;
 	charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&database=3D=
 g
 cc&pr=3D9103
 <http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&database=
 =3D
 gcc&pr=3D9103> =20
 
 Sorry - I tried to attach 2 files when I submitted the above report but
 somehow managed to attach only the results file. Attached to this email
 is the other (more useful) one - the source!
 
 regards
 
 Darryl Green.
 
 =20
 
 =20
 
 =20
 
 =20
 
 
 ------_=_NextPart_002_01C2B077.865CD791
 Content-Type: text/html;
 	charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
 <html>
 
 <head>
 <meta http-equiv=3DContent-Type content=3D"text/html; =
 charset=3Dus-ascii">
 <meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
 
 <style>
 <!--
  /* Style Definitions */
  p.MsoNormal, li.MsoNormal, div.MsoNormal
 	{margin:0cm;
 	margin-bottom:.0001pt;
 	font-size:12.0pt;
 	font-family:"Times New Roman";}
 a:link, span.MsoHyperlink
 	{color:blue;
 	text-decoration:underline;}
 a:visited, span.MsoHyperlinkFollowed
 	{color:blue;
 	text-decoration:underline;}
 p
 	{margin-right:0cm;
 	margin-left:0cm;
 	font-size:12.0pt;
 	font-family:"Times New Roman";}
 span.EmailStyle18
 	{font-family:Arial;}
 @page Section1
 	{size:595.3pt 841.9pt;
 	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
 div.Section1
 	{page:Section1;}
 -->
 </style>
 
 </head>
 
 <body lang=3DEN-AU link=3Dblue vlink=3Dblue>
 
 <div class=3DSection1>
 
 <p><font size=3D2 face=3DArial><span =
 style=3D'font-size:10.0pt;font-family:Arial'><a
 href=3D"http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&a=
 mp;database=3Dgcc&amp;pr=3D9103"><!-- Converted from text/rtf format =
 -->http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&amp;da=
 tabase=3Dgcc&amp;pr=3D9103</a></span></font>
 </p>
 
 <p><font size=3D3 face=3D"Times New Roman"><span =
 style=3D'font-size:12.0pt'>Sorry &#8211;
 I tried to attach 2 files when I submitted the above report but somehow =
 managed
 to attach only the results file. Attached to this email is the other =
 (more
 useful) one &#8211; the source!</span></font></p>
 
 <p><font size=3D3 face=3D"Times New Roman"><span =
 style=3D'font-size:12.0pt'>regards</span></font></p>
 
 <p><font size=3D3 face=3D"Times New Roman"><span =
 style=3D'font-size:12.0pt'>Darryl Green</span></font>.</p>
 
 <p><font size=3D3 face=3D"Times New Roman"><span =
 style=3D'font-size:12.0pt'>&nbsp;</span></font></p>
 
 <p><font size=3D3 face=3D"Times New Roman"><span =
 style=3D'font-size:12.0pt'>&nbsp;</span></font></p>
 
 <p><font size=3D3 face=3D"Times New Roman"><span =
 style=3D'font-size:12.0pt'>&nbsp;</span></font></p>
 
 <p><font size=3D3 face=3D"Times New Roman"><span =
 style=3D'font-size:12.0pt'>&nbsp;</span></font></p>
 
 </div>
 
 </body>
 
 </html>
 =00
 ------_=_NextPart_002_01C2B077.865CD791--
 
 ------_=_NextPart_001_01C2B077.865CD791
 Content-Type: application/octet-stream;
 	name="test.cpp"
 Content-Transfer-Encoding: base64
 Content-Description: test.cpp
 Content-Disposition: attachment;
 	filename="test.cpp"
 
 Ly8gdHJpdmlhbC9zaWxseSAgk3BvbGljeZQNDQpzdHJ1Y3QgaW1wbF90DQ0Kew0NCiAgICBpbnQg
 aTsNDQogICAgaW1wbF90KGludCB2PTApIDogaSh2KSB7fQ0NCiAgICBpbnQgZ2V0KCkge3JldHVy
 biBpOyB9DQ0KICAgIHZvaWQgc2V0KGludCB2KSB7aSA9IHY7IH0NDQp9Ow0NCg0NCi8vIHR5cGVk
 ZWYgYm9vc3Q6OnNoYXJlZF9wdHI8aW1wbF90PiBpbXBsX3B0cl90Ow0NCi8vIHF1aWNrIGhhY2sg
 dG8gcmVtb3ZlIGRlcGVuZGVuY3kgb24gc2hhcmVkX3B0ciBhbmQgdGVtcGxhdGUgaGFuZGxpbmcg
 Zm9yIHRlc3RpbmcgdXNpbmcgYSBjb3B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90KDUwKSApICk7IC8vIGNvbXBpbGVzDQ0KICAgIHVzZXJfZnJvbV90
 ZW1wcy5kb19zdHVmZigpOyAvLyBubyBlcnJvcg0NCn0NDQoNDQp9DQ0KDQ0K
 
 ------_=_NextPart_001_01C2B077.865CD791--


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

* c++/9103: problems constructing from temporaries
@ 2002-12-29 21:46 darryl.green
  0 siblings, 0 replies; 7+ messages in thread
From: darryl.green @ 2002-12-29 21:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9103
>Category:       c++
>Synopsis:       problems constructing from temporaries
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 29 21:46:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Darryl Green
>Release:        gcc version 3.2.1 20020924 (Debian prerelease)
>Organization:
>Environment:
Linux 2.4.19
>Description:
Moderately complex object declaration/construction involving multiple temporaries is not handled correctly - gcc seems to be interpreting it as a function declaration.

Note: fwiw Comeau online and MSVC 7 compile this code.
>How-To-Repeat:
Compile the code. Examine error output.
>Fix:

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

test.cpp: In function `int main()':
test.cpp:55: request for member `do_stuff' in `user_from_temps()', which is of 
   non-aggregate type `policy_user ()()'


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

end of thread, other threads:[~2003-04-07 14:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 14:04 c++/9103: problems constructing from temporaries bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07 11:06 Giovanni Bajo
2003-01-24 16:27 bangerth
2003-01-24 16:16 Giovanni Bajo
2002-12-31 11:46 Andrew Pinski
2002-12-30 18:56 Darryl Green
2002-12-29 21:46 darryl.green

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).