This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

[PATCH] Fix PR c++/23959, wrong warning for -Wswitch-default


The problem here is that we were trying to warn when processing a template
function. We really only need to call do_switch_warnings when we are
instantiating the template which was the behavior in GCC before 4.0.0.


OK for the mainline and 4.0.0? Bootstrapped and tested on
x86_64-pc-linux-gnu with no regressions.

Thanks,
Andrew Pinski

cp/ChangeLog:

	* decl.c (pop_switch): Only call c_do_switch_warnings
	when not processing templates.

testsuite/ChangeLog:

	* g++.dg/warn/Wswitch-default-1.C: New test.
	* g++.dg/warn/Wswitch-default-2.C: New test.



Attachment: fixPR23959.diff.txt
Description: Text document


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