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.
PR c++/85008
* g++.dg/pr85008.C: New.
===================================================================
@@ -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));
===================================================================
@@ -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)
===================================================================
@@ -0,0 +1,8 @@
+// PR c++/85008 ICE concerning dtor clones
+
+void a() {
+ struct b {
+ ~b();
+ int r [!!&b::~b]; // { dg-error "address of " }
+ };
+}