Remove FIELD_DECL leftover.
authorMartin Liska <mliska@suse.cz>
Tue, 5 Nov 2019 08:39:14 +0000 (09:39 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 5 Nov 2019 08:39:14 +0000 (08:39 +0000)
2019-11-05  Martin Liska  <mliska@suse.cz>

PR c++/92339
* fold-const.c (operand_compare::hash_operand): Remove
FIELD_DECL handling.
2019-11-05  Martin Liska  <mliska@suse.cz>

PR c++/92339
* g++.dg/pr92339.C: New test.

From-SVN: r277816

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr92339.C [new file with mode: 0644]

index f492ea6da0c6c5fc39f845b3c900f13ba0051bae..2d11f3deac631779f48a45f0e191e09cf03c98c0 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-05  Martin Liska  <mliska@suse.cz>
+
+       PR c++/92339
+       * fold-const.c (operand_compare::hash_operand): Remove
+       FIELD_DECL handling.
+
 2019-11-05  Aldy Hernandez  <aldyh@redhat.com>
 
        * tree-vrp.h (vrp_bitmap_equal_p): Remove.
index 1e25859a707b4bf28a21be3658cd9e95402f510c..88a069f4306794b42d718136cb8c8b3e1efc0c6c 100644 (file)
@@ -3682,10 +3682,6 @@ operand_compare::hash_operand (const_tree t, inchash::hash &hstate,
     case IDENTIFIER_NODE:
       hstate.add_object (IDENTIFIER_HASH_VALUE (t));
       return;
-    case FIELD_DECL:
-      inchash::add_expr (DECL_FIELD_OFFSET (t), hstate, flags);
-      inchash::add_expr (DECL_FIELD_BIT_OFFSET (t), hstate, flags);
-      return;
     case FUNCTION_DECL:
       /* When referring to a built-in FUNCTION_DECL, use the __builtin__ form.
         Otherwise nodes that compare equal according to operand_equal_p might
index cdb6b31286a97a0a10b4135352d620392bb6dcd3..db8798b9c112e0a0c80f68efb001863d8eca5c3e 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-05  Martin Liska  <mliska@suse.cz>
+
+       PR c++/92339
+       * g++.dg/pr92339.C: New test.
+
 2019-11-05  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.dg/gomp/declare-variant-7.C: New test.
diff --git a/gcc/testsuite/g++.dg/pr92339.C b/gcc/testsuite/g++.dg/pr92339.C
new file mode 100644 (file)
index 0000000..5bf15b0
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR c++/92339  */
+/* { dg-options "-std=c++11" } */
+
+class a {
+  template <typename b, b a::*> struct c { c(a *); };
+  int m_fn1();
+  unsigned long d;
+  using e = c<unsigned long, &a::d>;
+};
+int a::m_fn1() { e(this); return 0; }