aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-08-18 16:05:40 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-08-18 16:05:40 +0000
commitc043ee4a3aca9dab1b13808abce5de717eced450 (patch)
tree1b236ea0b57d049c968cfe54f950db94f793ef09 /gcc
parent3ff91293eb19a5b6fa7fd47ca99b93d57d89570d (diff)
downloadgcc-c043ee4a3aca9dab1b13808abce5de717eced450.zip
gcc-c043ee4a3aca9dab1b13808abce5de717eced450.tar.gz
gcc-c043ee4a3aca9dab1b13808abce5de717eced450.tar.bz2
re PR c++/45049 (ICE: tree check: expected tree that contains 'decl minimal' structure, have 'tree_list' in push_overloaded_decl, at cp/name-lookup.c:2160)
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/name-lookup.c4
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/pr45049-1.C17
-rw-r--r--gcc/testsuite/g++.dg/pr45049-2.C9
5 files changed, 40 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b373266..f8e5354 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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,
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 01f29e4..800e340 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e4c980e..32f4228 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..7b1dcd5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr45049-1.C
@@ -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
index 0000000..a951884
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr45049-2.C
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void foo()
+{
+ void bar(int);
+ void baz(int);
+ void baz(void);
+ void bar(void);
+}