+2016-06-03 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/27100
+ * decl.c (duplicate_decls): Properly copy the
+ DECL_PENDING_INLINE_P, DECL_PENDING_INLINE_INFO and
+ DECL_SAVED_FUNCTION_DATA fields from OLDDECL to NEWDECL.
+
2016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
* semantics.c (finish_omp_clauses): Mark OpenACC reduction
}
else
{
- if (DECL_PENDING_INLINE_INFO (newdecl) == 0)
- DECL_PENDING_INLINE_INFO (newdecl) = DECL_PENDING_INLINE_INFO (olddecl);
+ if (DECL_PENDING_INLINE_P (olddecl))
+ {
+ DECL_PENDING_INLINE_P (newdecl) = 1;
+ DECL_PENDING_INLINE_INFO (newdecl)
+ = DECL_PENDING_INLINE_INFO (olddecl);
+ }
+ else if (DECL_PENDING_INLINE_P (newdecl))
+ ;
+ else if (DECL_SAVED_FUNCTION_DATA (newdecl) == NULL)
+ DECL_SAVED_FUNCTION_DATA (newdecl)
+ = DECL_SAVED_FUNCTION_DATA (olddecl);
DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl);
+2016-06-03 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/27100
+ * g++.dg/other/friend6.C: New test.
+
2016-06-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* g++.dg/torture/ppc-ldst-array.C: New.
--- /dev/null
+// PR c++/27100
+// This used to fail at link time with an "undefined reference to 'foo'" error.
+// { dg-do run }
+
+struct A
+{
+ friend void foo (const A&) { }
+ friend void foo (const A&);
+};
+
+int
+main ()
+{
+ foo (A ());
+}