[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
This commit is contained in:
Nathan Sidwell 2018-03-21 19:22:10 +00:00 committed by Nathan Sidwell
parent 983d49ddd1
commit b2595987bd
5 changed files with 21 additions and 2 deletions

View 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

View 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));

View 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)

View 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

View File

@ -0,0 +1,8 @@
// PR c++/85008 ICE concerning dtor clones
void a() {
struct b {
~b();
int r [!!&b::~b]; // { dg-error "address of " }
};
}