Is this a bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux