public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10827: member function pointer array link problem
@ 2003-05-16 22:16 giovannibajo
  0 siblings, 0 replies; 2+ messages in thread
From: giovannibajo @ 2003-05-16 22:16 UTC (permalink / raw)
  To: andre.maute, gcc-bugs, gcc-prs, nobody

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

Synopsis: member function pointer array link problem

State-Changed-From-To: open->closed
State-Changed-By: bajo
State-Changed-When: Fri May 16 22:16:23 2003
State-Changed-Why:
    Not a bug. ISO C++ standard mandates that you must always
    define static const member variables, even if initialized
    at declaration time. Quoting §9.4.2p4: "If a static data 
    member is of const integral or const enumeration type,
    its declaration in the class definition can specify a 
    constant-initializer which shall be an integral constant
    expression. [...] The member shall still be defined in a
    namespace scope if it is used in the program and the 
    namespace scope definition shall not contain an initializer."
    
    This leads us to the second problem of your code: ISO C++
    allows in-class initialization only for static const member
    of integral or enumeration type. In your case, the member
    type is neither integral or enumeration, so the code is
    ill-formed. It used to be accepted for a GCC extension
    (if you try to compile with -pedantic, you get a warning
    about it), but the extension has been removed already in
    GCC 3.3. I suggest to update your code to reflect this
    (just initialize the member at namescope definition).

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10827


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/10827: member function pointer array link problem
@ 2003-05-16 21:46 andre.maute
  0 siblings, 0 replies; 2+ messages in thread
From: andre.maute @ 2003-05-16 21:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10827
>Category:       c++
>Synopsis:       member function pointer array link problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 16 21:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     andre.maute@gmx.de
>Release:        gcc-3.2.1
>Organization:
>Environment:
binutils-2.13.2
>Description:
the attached file does compile but will not link due to undefined references
>How-To-Repeat:
g++ test.cc
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"

I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgQSB7CiAgIHB1YmxpYzoKCXZvaWQgZigpIHtzdGQ6
OmNvdXQgPDwgImYiIDw8IHN0ZDo6ZW5kbDt9OwoJdm9pZCBnKCkge3N0ZDo6Y291dCA8PCAiZyIg
PDwgc3RkOjplbmRsO307CgoJdHlwZWRlZiB2b2lkIChBOjoqQU1lbUZuKSgpOyAKCglzdGF0aWMg
Y29uc3QgQU1lbUZuIGZwYVs0XSA9IHsgJkE6OmYsICZBOjpnIH07Cn07CgkJCSAgIAoKaW50IG1h
aW4oKSB7CgoJQSBhOwoJQTo6QU1lbUZuIGFtZiA9IEE6OmZwYVswXTsKCgkoKGEpLiooYW1mKSko
KTsKCglyZXR1cm4gMDsKCn0KCg==


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-16 22:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-16 22:16 c++/10827: member function pointer array link problem giovannibajo
  -- strict thread matches above, loose matches on Subject: below --
2003-05-16 21:46 andre.maute

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).