public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Strange warning message
@ 1998-10-23 13:29 Andrey Slepuhin
  1998-10-29 19:35 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Slepuhin @ 1998-10-23 13:29 UTC (permalink / raw)
  To: egcs

Hi,
Compiling the following file

---- tmp.cc ----
namespace N {

template <typename T>
class X
{
  union
  {
    int a;
    char b;
  };
};

}

using namespace N;

void main()
{
  X<int> x;
}
-------------------

with egcs-1.1 I received the following strange warnings:

tmp.cc: In instantiation of `::N::::N::X<int>':
tmp.cc:19:   instantiated from here
tmp.cc:8: warning: private member `int X<int>::{anonymous union}::a' in
anonymous union
tmp.cc:9: warning: private member `char X<int>::{anonymous union}::b' in
anonymous union

If I remove namespaces or if class X is not a template class, warnings are
not generated.
Is it normal behavior?

Regards,
Andrey.


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

* Re: Strange warning message
  1998-10-23 13:29 Strange warning message Andrey Slepuhin
@ 1998-10-29 19:35 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 1998-10-29 19:35 UTC (permalink / raw)
  To: Andrey Slepuhin; +Cc: egcs

Andrey Slepuhin <pooh@msu.ru> writes:

> tmp.cc:8: warning: private member `int X<int>::{anonymous union}::a' in
> anonymous union
> tmp.cc:9: warning: private member `char X<int>::{anonymous union}::b' in
> anonymous union

> If I remove namespaces or if class X is not a template class,
> warnings are not generated.  Is it normal behavior?

Nope.  Fixed in the latest snapshot.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


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

end of thread, other threads:[~1998-10-29 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-23 13:29 Strange warning message Andrey Slepuhin
1998-10-29 19:35 ` Alexandre Oliva

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