This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/2768: odd warning on spurious 'static'
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2768: odd warning on spurious 'static'
- From: bh at techhouse dot org
- Date: 7 May 2001 22:31:37 -0000
- Reply-To: bh at techhouse dot org
>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: