]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/45049 (ICE: tree check: expected tree that contains 'decl minimal' structur...
authorNathan Froyd <froydnj@codesourcery.com>
Wed, 18 Aug 2010 16:05:40 +0000 (16:05 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Wed, 18 Aug 2010 16:05:40 +0000 (16:05 +0000)
gcc/cp/
PR c++/45049
* name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
TREE_CHAIN.

gcc/testsuite/
PR c++/45049
* g++.dg/pr45049-1.C: New test.
* g++.dg/pr45049-2.C: New test.

From-SVN: r163344

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

index b37326619153daaa4f94a26dab1947e0d83abd5d..f8e53540382b4bad72b482c050eef9cfd91d82b7 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-18  Nathan Froyd  <froydnj@codesourcery.com>
+
+       PR c++/45049
+       * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
+       TREE_CHAIN.
+
 2010-08-17  Kai Tietz  <kai.tietz@onevision.com>
 
        * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
index 01f29e43772ae9b518ecad5523350655497d2ecb..800e340de95ba288553b623a4efa31e5895d247d 100644 (file)
@@ -2157,7 +2157,7 @@ push_overloaded_decl (tree decl, int flags, bool is_friend)
 
          for (d = &IDENTIFIER_BINDING (name)->scope->names;
               *d;
-              d = &DECL_CHAIN (*d))
+              d = &TREE_CHAIN (*d))
            if (*d == old
                || (TREE_CODE (*d) == TREE_LIST
                    && TREE_VALUE (*d) == old))
@@ -2168,7 +2168,7 @@ push_overloaded_decl (tree decl, int flags, bool is_friend)
                else
                  /* Build a TREE_LIST to wrap the OVERLOAD.  */
                  *d = tree_cons (NULL_TREE, new_binding,
-                                 DECL_CHAIN (*d));
+                                 TREE_CHAIN (*d));
 
                /* And update the cxx_binding node.  */
                IDENTIFIER_BINDING (name)->value = new_binding;
index e4c980e406268314e346da4b7c21ee8efd77e7c5..32f4228df4594f6e5224531e64adeeb499ac834a 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-18  Nathan Froyd  <froydnj@codesourcery.com>
+
+       PR c++/45049
+       * g++.dg/pr45049-1.C: New test.
+       * g++.dg/pr45049-2.C: New test.
+
 2010-08-18  Jie Zhang  <jie@codesourcery.com>
 
        * gcc.dg/builtin-apply2.c (STACK_ARGUMENTS_SIZE): Define to
diff --git a/gcc/testsuite/g++.dg/pr45049-1.C b/gcc/testsuite/g++.dg/pr45049-1.C
new file mode 100644 (file)
index 0000000..7b1dcd5
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+namespace n1 {
+  void modf ();
+}
+
+namespace n2 {
+  void trunc ();
+  void modf ();
+}
+    
+void max ()
+{
+  using n1::modf;
+  using n2::trunc;
+  using n2::modf;
+}
diff --git a/gcc/testsuite/g++.dg/pr45049-2.C b/gcc/testsuite/g++.dg/pr45049-2.C
new file mode 100644 (file)
index 0000000..a951884
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void foo()
+{
+  void bar(int);
+  void baz(int);
+  void baz(void);
+  void bar(void);
+}