This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25986] return from funcrtion of void value allowed
- From: "yuri at tsoft dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jan 2006 00:02:49 -0000
- Subject: [Bug c++/25986] return from funcrtion of void value allowed
- References: <bug-25986-6649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from yuri at tsoft dot com 2006-01-27 00:02 -------
> This functionality was *added* on
> purpose to allow generic codes to be written seamlessly
Sure!
Then code "void f() { void x; retrun (x); }" should work. But it produces:
t.C: In function `void f()':
t.C:2: variable or field `x' declared void
t.C:2: return-statement with a value, in function declared with a void return
type
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25986