[PR c++/85008] ICE looking for clone
authorNathan Sidwell <nathan@acm.org>
Wed, 21 Mar 2018 19:22:10 +0000 (19:22 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 21 Mar 2018 19:22:10 +0000 (19:22 +0000)
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01129.html
PR c++/85008
* tree.c (decl_linkage): Use DECL_CLONED_FUNCTION_P.
* decl2.c (vague_linkage_p): Likewise.

PR c++/85008
* g++.dg/pr85008.C: New.

From-SVN: r258738

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr85008.C [new file with mode: 0644]

index c8b6b1703bd6ebba59840e879599b47da0dc6e20..e97f99d0d3ff47ad57f678c2e40c02f6bc487b78 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-21  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/85008
+       * tree.c (decl_linkage): Use DECL_CLONED_FUNCTION_P.
+       * decl2.c (vague_linkage_p): Likewise.
+
 2018-03-21  David Malcolm  <dmalcolm@redhat.com>
 
        PR c++/84994
index 49d680f6e807b873dd1dd5c1b9ccded1cd377832..e522b9ebe55a708ec97adc163f050fb63294191d 100644 (file)
@@ -1940,7 +1940,7 @@ vague_linkage_p (tree decl)
       if ((DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)
           || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl))
          && DECL_CHAIN (decl)
-         && DECL_CLONED_FUNCTION (DECL_CHAIN (decl)))
+         && DECL_CLONED_FUNCTION_P (DECL_CHAIN (decl)))
        return vague_linkage_p (DECL_CHAIN (decl));
 
       gcc_checking_assert (!DECL_COMDAT (decl));
index 5993633cbe580b9d96f3f7eb17313075649ea9f0..f1a90bdec0fc4639957b259658276a6293cc0687 100644 (file)
@@ -5022,7 +5022,7 @@ decl_linkage (tree decl)
   if ((DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)
        || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl))
       && DECL_CHAIN (decl)
-      && DECL_CLONED_FUNCTION (DECL_CHAIN (decl)))
+      && DECL_CLONED_FUNCTION_P (DECL_CHAIN (decl)))
     return decl_linkage (DECL_CHAIN (decl));
 
   if (TREE_CODE (decl) == NAMESPACE_DECL)
index 43122bb71b49f89889086430d35d25219b35f96c..6ecd1f502e1d59937b6cc607916093b8fd0686eb 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-21  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/85008
+       * g++.dg/pr85008.C: New.
+
 2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>
 
        PR fortran/84615
diff --git a/gcc/testsuite/g++.dg/pr85008.C b/gcc/testsuite/g++.dg/pr85008.C
new file mode 100644 (file)
index 0000000..a9e515b
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/85008 ICE concerning dtor clones
+
+void a() {
+  struct b {
+    ~b();
+    int r [!!&b::~b]; // { dg-error "address of " }
+  };
+}