Bug 58908

Summary: No unused parameter warning from gcc 3.1-0.18
Product: [Retired] Red Hat Raw Hide Reporter: Peter Klotz <peter.klotz99>
Component: gcc3Assignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-02 20:06:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Klotz 2002-01-27 18:39:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
gcc 3.1-0.18 does not emit a warning when a parameter is not used
in a constructor body. gcc 2.95.3 does.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. g++ -W -Wall -Wunused-parameter warning.cpp
2.
3.
	

Actual Results:  No warning is displayed

Expected Results:  Something like this (taken from gcc 2.95.3)

warning.cpp: In method `A::A(int)':
warning.cpp:4: warning: unused parameter `int i'

Additional info:

class A
{
public:
    A(int i) {};
};

int main(void)
{
    A(3);
    return 0;
}

Comment 1 Jakub Jelinek 2004-10-02 20:06:24 UTC
Sounds like PR c++/9848, fixed ATM in GCC 3.4.x and later.
Though, there are now 2 warnings emitted instead of one, filed
as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17796