public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ PATCH] PR c++80891 case #4
@ 2017-05-29 17:27 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2017-05-29 17:27 UTC (permalink / raw)
  To: GCC Patches; +Cc: Markus Trippelsdorf

[-- Attachment #1: Type: text/plain, Size: 94 bytes --]

this fixes the 4th testcase.  I'd flubbed the sense of an assert.

nathan

-- 
Nathan Sidwell

[-- Attachment #2: 80891-4.diff --]
[-- Type: text/x-patch, Size: 2315 bytes --]

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.

	PR c++/80891 (#4)
	* g++.dg/lookup/pr80891-4.C: New.

Index: cp/ptree.c
===================================================================
--- cp/ptree.c	(revision 248574)
+++ cp/ptree.c	(working copy)
@@ -236,11 +236,8 @@ cxx_print_xnode (FILE *file, tree node,
 		  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);
Index: cp/tree.c
===================================================================
--- cp/tree.c	(revision 248574)
+++ cp/tree.c	(working copy)
@@ -2170,7 +2170,7 @@ ovl_insert (tree fn, tree maybe_ovl, boo
 		       | (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 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;
Index: testsuite/g++.dg/lookup/pr80891-4.C
===================================================================
--- testsuite/g++.dg/lookup/pr80891-4.C	(revision 0)
+++ testsuite/g++.dg/lookup/pr80891-4.C	(working copy)
@@ -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();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-29 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-29 17:27 [C++ PATCH] PR c++80891 case #4 Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).