re PR debug/22514 (ICE in force_decl_die with invalid code after error)
authorJames A. Morrison <phython@gcc.gnu.org>
Sat, 6 Aug 2005 05:18:09 +0000 (05:18 +0000)
committerJames A. Morrison <phython@gcc.gnu.org>
Sat, 6 Aug 2005 05:18:09 +0000 (05:18 +0000)
2005-08-05  James A. Morrison  <phython@gcc.gnu.org>

        PR c++/22514
        * name-lookup.c (cp_emit_debug_info_for_using): Do nothing if
        sorrycount or errorcount are nonzero.

From-SVN: r102799

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/pr22514.C [new file with mode: 0644]

index 6c4108faf90bcd1e20500d9e6827001445a96f66..574918b60bf2f7bac4805a625163c7c288d4065f 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-05  James A. Morrison  <phython@gcc.gnu.org>
+
+       PR c++/22514
+       * name-lookup.c (cp_emit_debug_info_for_using): Do nothing if
+       sorrycount or errorcount are nonzero.
+
 2005-08-05  Mark Mitchell  <mark@codesourcery.com>
 
        * name-lookup.c (pushtag): Remove accidental commit from:
index 70ecfadcbae290b18e8cac376ac6ee87b3b5b139..a03b648398ac4540c06300e42ea4f786a5c3f063 100644 (file)
@@ -4949,6 +4949,10 @@ pop_everything (void)
 void
 cp_emit_debug_info_for_using (tree t, tree context)
 {
+  /* Don't try to emit any debug information if we have errors.  */
+  if (sorrycount || errorcount)
+    return;
+
   /* Ignore this FUNCTION_DECL if it refers to a builtin declaration
      of a builtin function.  */
   if (TREE_CODE (t) == FUNCTION_DECL
index 8e512b27260b2673325acd3a629e553ba7c7226a..d0fb7f368bb877e2c06de863f853fc3a62a41377 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-05  James A. Morrison  <phython@gcc.gnu.org>
+
+       * g++.dg/parse/pr22514.C: New test.
+
 2005-08-05  J"orn Rennecke <joern.rennecke@st.com>
 
        * gcc.dg/intmax_t-1.c: Extend dg-error to cover sh*-*-elf targets.
diff --git a/gcc/testsuite/g++.dg/parse/pr22514.C b/gcc/testsuite/g++.dg/parse/pr22514.C
new file mode 100644 (file)
index 0000000..23dc9b2
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+namespace s
+{
+  template <int> struct _List_base
+  {
+     int _M_impl;
+  };
+  template<int i> struct list : _List_base<i>
+  {
+    using _List_base<i>::_M_impl;
+  }
+}  /* { dg-error "expected unqualified-id before '\}'" } */
+s::list<1> OutputModuleListType;  /* { dg-error "expected" } */