]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/20552 (ICE in write_type, at cp/mangle.c:1579)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 19 Dec 2005 17:26:29 +0000 (17:26 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 19 Dec 2005 17:26:29 +0000 (17:26 +0000)
PR c++/20552
Backport:
2004-03-08  Mark Mitchell  <mark@codesourcery.com>
* decl.c (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.

* g++.dg/ext/typeof10.C: New test.

From-SVN: r108795

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/typeof10.C [new file with mode: 0644]

index cdfb99314674fa28a9a9fba211c9fc91caa9617e..c540dbde9054a0edc4dcba489b5595761feec015 100644 (file)
@@ -1,3 +1,11 @@
+2005-12-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/20552
+       Backport:
+       2004-03-08  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl.c (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
+
 2005-12-07  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/19397
index b9199da3169f409c3c3cac58e8010f12aafe32cf..5adb3a8d3f0c11bbc03a94eae3ae94249e871dff 100644 (file)
@@ -1380,10 +1380,7 @@ duplicate_decls (tree newdecl, tree olddecl)
          else
            return NULL_TREE;
        }
-
-      /* Already complained about this, so don't do so again.  */
-      else if (current_class_type == NULL_TREE
-         || IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type)
+      else
        {
          error ("conflicting declaration '%#D'", newdecl);
          cp_error_at ("'%D' has a previous declaration as `%#D'",
index 9eee42191478d9ecd047be7347bbaaeb2fb85492..b66555668ac08a9beb14fb16c246b95cbe6da4c5 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/20552
+       * g++.dg/ext/typeof10.C: New test.
+
 2005-12-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * g++.old-deja/g++.brendan/redecl1.C,
diff --git a/gcc/testsuite/g++.dg/ext/typeof10.C b/gcc/testsuite/g++.dg/ext/typeof10.C
new file mode 100644 (file)
index 0000000..1b357ad
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/20552
+// Origin: Ivan Godard <igodard@pacbell.net>
+
+template<int> struct A
+{
+  void foo()
+  {
+    typedef int T;                // { dg-error "previous" }
+    typedef __typeof__(*this) T;  // { dg-error "conflicting" }
+  }
+};