+2005-10-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/23959
+ * decl.c (pop_switch): Only call c_do_switch_warnings
+ when not processing templates.
+
2005-10-16 Mark Mitchell <mark@codesourcery.com>
PR c++/22173
switch_location = EXPR_LOCATION (cs->switch_stmt);
else
switch_location = input_location;
- c_do_switch_warnings (cs->cases, switch_location,
- SWITCH_STMT_TYPE (cs->switch_stmt),
- SWITCH_STMT_COND (cs->switch_stmt));
+ if (!processing_template_decl)
+ c_do_switch_warnings (cs->cases, switch_location,
+ SWITCH_STMT_TYPE (cs->switch_stmt),
+ SWITCH_STMT_COND (cs->switch_stmt));
splay_tree_delete (cs->cases);
switch_stack = switch_stack->next;
+2005-10-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/23959
+ * g++.dg/warn/Wswitch-default-1.C: New test.
+ * g++.dg/warn/Wswitch-default-2.C: New test.
+
2005-10-16 Mark Mitchell <mark@codesourcery.com>
PR c++/22173
--- /dev/null
+// PR C++/21123
+/* { dg-do compile } */
+/* { dg-options "-Wswitch-default" } */
+
+
+template <typename ArrayType>
+void foo( )
+{
+ int i = 0;
+
+ switch ( i ) /* { dg-bogus "switch missing default case" } */
+ {
+ case 9:
+ default:
+ break;
+ }
+}
+
+void f()
+{
+ foo<int>();
+}
--- /dev/null
+// PR C++/21123
+/* { dg-do compile } */
+/* { dg-options "-Wswitch-default" } */
+
+
+template <typename ArrayType>
+void foo( )
+{
+ int i = 0;
+
+ switch ( i ) /* { dg-warning "switch missing default case" } */
+ {
+ case 9:
+ break;
+ }
+}
+
+void f()
+{
+ foo<int>();
+}