public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* middle-end/6033: Naming and returning a value from a void function causes an internal compiler error (g++)
@ 2002-03-21 23:46 hezamu
  0 siblings, 0 replies; 2+ messages in thread
From: hezamu @ 2002-03-21 23:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6033
>Category:       middle-end
>Synopsis:       Naming and returning a value from a void function causes an internal compiler error (g++)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 21 23:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Henri Muurimaa
>Release:        g++ 2.95.2
>Organization:
>Environment:
Debian Linux 2.2r5
>Description:
If I have a function returning void but name its return value, and have it return it, ie:

void foo() return retval
{
     return retval
}

I get a internal compiler error:
foo.c: In function `void foo()':
foo.c:3: Internal compiler error in `expand_expr', at expr.c:5771
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.          

This is probably a trivial bug (I haven't looked at the source), but the compiler asked me to report the bug, so here you are.
>How-To-Repeat:
Type the trivial example function shown in the bug description to a file, and try to compile it with g++
>Fix:
Naming a void function's return value is obviously a stupid mistake from the coder's part, so to avoid the problem, don't do stupid mistakes :)
>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: middle-end/6033: Naming and returning a value from a void function causes an internal compiler error (g++)
@ 2002-03-22 19:51 rodrigc
  0 siblings, 0 replies; 2+ messages in thread
From: rodrigc @ 2002-03-22 19:51 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, hezamu, nobody

Synopsis: Naming and returning a value from a void function causes an internal compiler error (g++)

State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Fri Mar 22 19:51:34 2002
State-Changed-Why:
    This code example returns a parse error with gcc 3.0.4:
    
    a.c:1: parse error before "return"

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


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

end of thread, other threads:[~2002-03-23  3:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-21 23:46 middle-end/6033: Naming and returning a value from a void function causes an internal compiler error (g++) hezamu
2002-03-22 19:51 rodrigc

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