re PR c++/13179 (ICE w/template parameter in catch specification)
authorMark Mitchell <mark@codesourcery.com>
Thu, 4 Dec 2003 05:02:20 +0000 (05:02 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 4 Dec 2003 05:02:20 +0000 (05:02 +0000)
PR c++/13179
* semantics.c (finish_handler_parms): Do not call eh_type_info for
types used in templates.

PR c++/13179
* g++.dg/template/eh1.C: New test.

From-SVN: r74269

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/eh1.C [new file with mode: 0644]

index de5c7142d5bf89e442533c4a7fc00092a41833f6..dbb0d003772d929d5d4421dfcd4b4d45746ca04c 100644 (file)
@@ -1,5 +1,9 @@
 2003-12-03  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/13179
+       * semantics.c (finish_handler_parms): Do not call eh_type_info for
+       types used in templates.
+
        PR c++/10771
        * parser.c (cp_parser_check_for_invalid_template_id): New
        function.
index cb259726ee85fae276690ae77aaf79d0395c9c9f..a5e93a235679e324ba80416dcf54a7029d16707b 100644 (file)
@@ -960,7 +960,7 @@ finish_handler_parms (tree decl, tree handler)
     type = expand_start_catch_block (decl);
 
   HANDLER_TYPE (handler) = type;
-  if (type)
+  if (!processing_template_decl && type)
     mark_used (eh_type_info (type));
 }
 
index 2a30f30ccc3d933531743a4ee44eed94e2d90796..09e058d6e244b3fec363c2d1fdece0981631c31b 100644 (file)
@@ -4,6 +4,9 @@
 
 2003-12-03  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/13179
+       * g++.dg/template/eh1.C: New test.
+
        PR c++/10771
        * g++.dg/template/error5.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/template/eh1.C b/gcc/testsuite/g++.dg/template/eh1.C
new file mode 100644 (file)
index 0000000..134a0e7
--- /dev/null
@@ -0,0 +1,6 @@
+template <class T>
+void foo()
+{
+  try {}
+  catch(T e) {}
+}