This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/2768: odd warning on spurious 'static'



>Number:         2768
>Category:       c++
>Synopsis:       odd warning on spurious 'static'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 15:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Benoit Hudson
>Release:        2.92.2 and codesourcery 2001-05-07
>Organization:
>Environment:

>Description:
The illegal code in the how-to-repeat section produces the
message:
	"static member `A::data' re-declared as static"

That's rather obscure.  The message for the identical 
situation for functions is slightly more illuminating:
	"cannot declare member function `A::f()' to have static linkage"
>How-To-Repeat:
class A {
    public:
        static int data;
        static int f();
};
static int A::data;
static int A::f() { return 0; }
>Fix:
Fix the message for data members to be the same as for
functions.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]