aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-05-29 16:50:41 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-05-29 16:50:41 +0000
commita5cfa13ab9ef5b9a740129fca6b73acea436c493 (patch)
tree2fc8718059ccf433205f8e19102a61ef691a7320 /gcc
parent3c9cca8848a19225074fbdbe597b889ab00114d8 (diff)
downloadgcc-a5cfa13ab9ef5b9a740129fca6b73acea436c493.zip
gcc-a5cfa13ab9ef5b9a740129fca6b73acea436c493.tar.gz
gcc-a5cfa13ab9ef5b9a740129fca6b73acea436c493.tar.bz2
PR c++/80891 (#4)
PR c++/80891 (#4) * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure. * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert. PR c++/80891 (#4) * g++.dg/lookup/pr80891-4.C: New. From-SVN: r248576
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/ptree.c7
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/lookup/pr80891-4.C13
5 files changed, 24 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4a9ba45..faae715 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2017-05-29 Nathan Sidwell <nathan@acm.org>
+ PR c++/80891 (#4)
+ * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
+ * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
+
Stat hack representation
* name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index a2977e8..f8e879e 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -236,11 +236,8 @@ cxx_print_xnode (FILE *file, tree node, int indent)
indent + 4);
break;
case OVERLOAD:
- print_node (file, "name", OVL_NAME (node), indent+4);
- for (ovl_iterator iter (node, true); iter; ++iter)
- print_node (file,
- TREE_CODE (*iter) == OVERLOAD ? "inner" : "function",
- *iter, indent+4);
+ print_node (file, "function", OVL_FUNCTION (node), indent+4);
+ print_node (file, "next", OVL_CHAIN (node), indent+4);
break;
case TEMPLATE_PARM_INDEX:
print_node (file, "decl", TEMPLATE_PARM_DECL (node), indent+4);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 37297d2..411c9f3 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2170,7 +2170,7 @@ ovl_insert (tree fn, tree maybe_ovl, bool using_p)
| (OVL_USING_P (maybe_ovl) << 0))))
{
gcc_checking_assert (!OVL_LOOKUP_P (maybe_ovl)
- && (!OVL_USED_P (maybe_ovl) || !copying));
+ && (!copying || OVL_USED_P (maybe_ovl)));
if (OVL_USED_P (maybe_ovl))
{
copying = true;
@@ -2264,7 +2264,7 @@ ovl_iterator::remove_node (tree overload, tree node)
{
tree probe = *slot;
gcc_checking_assert (!OVL_LOOKUP_P (probe)
- && (!OVL_USED_P (probe) || !copying));
+ && (!copying || OVL_USED_P (probe)));
if (OVL_USED_P (probe))
{
copying = true;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 98e06f9..4eb53a7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2017-05-29 Nathan Sidwell <nathan@acm.org>
+ PR c++/80891 (#4)
+ * g++.dg/lookup/pr80891-4.C: New.
+
PR c++/80891 (#1)
* g++.dg/lookup/pr80891-1.C: New.
diff --git a/gcc/testsuite/g++.dg/lookup/pr80891-4.C b/gcc/testsuite/g++.dg/lookup/pr80891-4.C
new file mode 100644
index 0000000..d536613
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/pr80891-4.C
@@ -0,0 +1,13 @@
+// PR c++/80891 part 4
+// Inserting into an immutable overload set
+
+namespace tuples {
+template <class, class> void get();
+template <int> void get();
+}
+using tuples::get;
+template <class RandomAccessIterator> void make_iterator_vertex_map() {
+ RandomAccessIterator a;
+ a, get;
+}
+template <class> void get();