From b2595987bd320849de932cd2bcf83d2faf5f3ee8 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 21 Mar 2018 19:22:10 +0000 Subject: [PATCH] [PR c++/85008] ICE looking for clone 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 | 6 ++++++ gcc/cp/decl2.c | 2 +- gcc/cp/tree.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/pr85008.C | 8 ++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/pr85008.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c8b6b1703bd..e97f99d0d3f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-03-21 Nathan Sidwell + + PR c++/85008 + * tree.c (decl_linkage): Use DECL_CLONED_FUNCTION_P. + * decl2.c (vague_linkage_p): Likewise. + 2018-03-21 David Malcolm PR c++/84994 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 49d680f6e80..e522b9ebe55 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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)); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 5993633cbe5..f1a90bdec0f 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 43122bb71b4..6ecd1f502e1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-21 Nathan Sidwell + + PR c++/85008 + * g++.dg/pr85008.C: New. + 2018-03-21 Janne Blomqvist PR fortran/84615 diff --git a/gcc/testsuite/g++.dg/pr85008.C b/gcc/testsuite/g++.dg/pr85008.C new file mode 100644 index 00000000000..a9e515b57ec --- /dev/null +++ b/gcc/testsuite/g++.dg/pr85008.C @@ -0,0 +1,8 @@ +// PR c++/85008 ICE concerning dtor clones + +void a() { + struct b { + ~b(); + int r [!!&b::~b]; // { dg-error "address of " } + }; +} -- 2.30.2