This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Is this a bug?
- From: "Lev Assinovsky" <LAssinovsky at algorithm dot aelita dot com>
- To: "Gcc-Bugs (E-mail)" <gcc-bugs at gcc dot gnu dot org>,"Gcc-Help (E-mail)" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 12 Aug 2003 20:27:17 +0400
- Subject: Is this a bug?
gcc 3.2.3, HPUX-11.00:
typedef struct { int a, b; } item;
class A {
public:
static const item * f()
{
static const item arr[] = {{0,0}};
return arr;
}
};
The result:
t.cpp: In static member function `static const item* A::f()':
t.cpp:6: warning: sorry: semantics of inline function static data `const item
arr[1]' are wrong (you'll wind up with multiple copies)
t.cpp:6: warning: you can work around this by removing the initializer
----
Lev Assinovsky
Aelita Software Corporation
O&S Core Division, Programmer
ICQ# 165072909