This is the mail archive of the gcc-prs@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++/2349: Compiler generated copy-constructor generates warning for unused argument.



>Number:         2349
>Category:       c++
>Synopsis:       Compiler generated copy-constructor generates warning for unused argument.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 22 15:26:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Greg Bumgardner
>Release:        gcc 3.1 as of 2001-03-22
>Organization:
>Environment:
Redhat Linux 2.2.16
>Description:
Compiler generated copy-constructors produce warnings 
for unused argument if class has virtual destructor and
no members, and the compiler-generated copy-constructor 
is used to initialize an instance.

This problem seems to be very specific.
>How-To-Repeat:
c++ -W -Wall -Werror simple.cpp

produces:

cc1plus: warnings being treated as errors
simple.cpp: In method `Foo::Foo(const Foo&)':
simple.cpp:1: warning: unused parameter `const Foo&_ctor_arg'
>Fix:
Unknown.
This error was introduced sometime in the last month.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="simple.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="simple.cpp"

Y2xhc3MgRm9vIHsKICBwdWJsaWM6CiAgICB2aXJ0dWFsIH5Gb28odm9pZCkge30gLy8gV2Fybmlu
ZyByZXF1aXJlcyBleGlzdGFuY2Ugb2YgdmlydHVhbCBkZXN0cnVjdG9yIAp9OwoKY2xhc3MgQmFy
IHsKICBwdWJsaWM6CiAgICB+QmFyKHZvaWQpIHt9Cn07CgoKaW50IG1haW4oKSB7CgogIEZvbyBm
MTsKICBGb28gZjIoZjEpOyAvLyBHZW5lcmF0ZXMgd2FybmluZwogIEZvbyBmMyhGb28oKSk7IC8v
IERvZXMgbm90IGdlbmVyYXRlIHdhcm5pbmcKICAodm9pZClmMTsKICAodm9pZClmMjsKICAodm9p
ZClmMzsKCiAgQmFyIGIxOwogIEJhciBiMihiMSk7IC8vIERvZXMgbm90IGdlbmVyYXRlIHdhcm5p
bmcKICAodm9pZCliMTsKICAodm9pZCliMjsKICByZXR1cm4gMDsKfQo=


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