This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Strange warning message
- To: egcs at cygnus dot com
- Subject: Strange warning message
- From: Andrey Slepuhin <pooh at msu dot ru>
- Date: Sat, 24 Oct 1998 00:29:49 +0400 (MEDT)
- Organization: Moscow State University Network (MSUnet)
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.