public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7780: -Woverloaded-virtual generating false-positives
@ 2002-08-30 12:35 linux_dr
0 siblings, 0 replies; only message in thread
From: linux_dr @ 2002-08-30 12:35 UTC (permalink / raw)
To: gcc-gnats
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2922 bytes --]
>Number: 7780
>Category: c++
>Synopsis: -Woverloaded-virtual generating false-positives
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Aug 30 11:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Loren Osborn <linux_dr@yahoo.com>
>Release: gcc 3.2
>Organization:
>Environment:
Linux Mandrake 8.1
>Description:
-Woverloaded-virtual reports that a member function "was hidden by" another member function any time a derived class implements a virtual function that is overloaded.
>From gcc man page:
-Woverloaded-virtual
(C++ only.) In a derived class, the
definitions of virtual functions must
match the type signature of a virtual
function declared in the base class. Use
this option to request warnings when
a derived class declares a function that
may be an erroneous attempt to define a
virtual function: that is, warn when a
function with the same name as a
virtual function in the base class, but
with a type signa ture that doesn't match
any virtual functions from the base class.
According to my interpertation of this it should only report overloading a member function where the base class does not declare the same member function with the same arguments.
See attached minimal test case.
>How-To-Repeat:
/usr/local/bin/g++ -Woverloaded-virtual -c -o /dev/null gcc-hiding-detection-bug.cpp
>Fix:
to detect these occurances as different situations
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc-hiding-detection-bug.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc-hiding-detection-bug.cpp"
LyogI2RlZmluZSBDQVVTRV9BTl9FUlJPUiAqLwpjbGFzcyBBCnsKCXB1YmxpYzoKCQl2aXJ0dWFs
IGludCBUaGlzRnVuY3Rpb25TaG91bGRDYXVzZUFIaWRpbmdXYXJuaW5nKGZsb2F0KTsKCQl2aXJ0
dWFsIGludCBUaGlzRnVuY3Rpb25TaG91bGRDYXVzZUFIaWRpbmdXYXJuaW5nKGNoYXIqKTsKCQl2
aXJ0dWFsIGludCBUaGlzRnVuY3Rpb25TaG91bGROb3RDYXVzZUFIaWRpbmdXYXJuaW5nKGNoYXIq
KTsKCQl2aXJ0dWFsIGludCBUaGlzRnVuY3Rpb25TaG91bGROb3RDYXVzZUFIaWRpbmdXYXJuaW5n
KGNoYXIqLGludCk7CiNpZmRlZiBDQVVTRV9BTl9FUlJPUgoJCXZpcnR1YWwgaW50IFRoaXNGdW5j
dGlvblNob3VsZENhdXNlQUVycm9yKGNoYXIqKTsKI2VuZGlmIC8vIENBVVNFX0FOX0VSUk9SCn07
CgpjbGFzcyBCIDogcHVibGljIEEKewoJcHVibGljOgoJCXZpcnR1YWwgaW50IFRoaXNGdW5jdGlv
blNob3VsZENhdXNlQUhpZGluZ1dhcm5pbmcoaW50KTsKCQl2aXJ0dWFsIGludCBUaGlzRnVuY3Rp
b25TaG91bGROb3RDYXVzZUFIaWRpbmdXYXJuaW5nKGNoYXIqLGludCk7CiNpZmRlZiBDQVVTRV9B
Tl9FUlJPUgoJCXZpcnR1YWwgY2hhciogVGhpc0Z1bmN0aW9uU2hvdWxkQ2F1c2VBRXJyb3IoY2hh
ciopOwojZW5kaWYgLy8gQ0FVU0VfQU5fRVJST1IKfTsKCmludCBtYWluKCkKewoJcmV0dXJuIDA7
Cn0K
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-08-30 18:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-30 12:35 c++/7780: -Woverloaded-virtual generating false-positives linux_dr
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).