public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28107] New: Incomplete type in struct added to global namespace
@ 2006-06-20 19:39 reichelt at gcc dot gnu dot org
2006-06-20 19:40 ` [Bug c++/28107] " pinskia at gcc dot gnu dot org
2007-08-17 15:37 ` pcarlini at suse dot de
0 siblings, 2 replies; 3+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-06-20 19:39 UTC (permalink / raw)
To: gcc-bugs
For the following invalid code snippet
==================
struct A
{
union B b;
};
struct B;
==================
the C++ frontend generates the following error message:
bug.cc:3: error: field 'b' has incomplete type
bug.cc:6: error: 'struct' tag used in naming 'union B'
While the first line is OK, the second one is not.
Apparently, union B is added to the global namespace.
IMHO it should be placed into A.
--
Summary: Incomplete type in struct added to global namespace
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: diagnostic, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28107
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/28107] Incomplete type in struct added to global namespace
2006-06-20 19:39 [Bug c++/28107] New: Incomplete type in struct added to global namespace reichelt at gcc dot gnu dot org
@ 2006-06-20 19:40 ` pinskia at gcc dot gnu dot org
2007-08-17 15:37 ` pcarlini at suse dot de
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-20 19:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-06-20 19:39 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-06-20 19:39:46
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28107
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/28107] Incomplete type in struct added to global namespace
2006-06-20 19:39 [Bug c++/28107] New: Incomplete type in struct added to global namespace reichelt at gcc dot gnu dot org
2006-06-20 19:40 ` [Bug c++/28107] " pinskia at gcc dot gnu dot org
@ 2007-08-17 15:37 ` pcarlini at suse dot de
1 sibling, 0 replies; 3+ messages in thread
From: pcarlini at suse dot de @ 2007-08-17 15:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pcarlini at suse dot de 2007-08-17 15:37 -------
FWIW, Comeau gives very similar errors:
"ComeauTest.c", line 3: error: incomplete type is not allowed
union B b;
^
"ComeauTest.c", line 6: error: tag kind of class or struct is incompatible with
declaration of union "B" (declared at line 3)
struct B;
^
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28107
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-17 15:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-20 19:39 [Bug c++/28107] New: Incomplete type in struct added to global namespace reichelt at gcc dot gnu dot org
2006-06-20 19:40 ` [Bug c++/28107] " pinskia at gcc dot gnu dot org
2007-08-17 15:37 ` pcarlini at suse dot de
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).