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; }
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