Re: [PATCH] Fix PR c++/27100

2016-05-31 Thread Jason Merrill
On Mon, May 30, 2016 at 4:19 PM, Patrick Palka wrote: > Here's a more straightforward version of the patch that abuses the fact > that the fields DECL_PENDING_INLINE_INFO and DECL_SAVED_FUNCTION_DATA > are a union. That gets into undefined behavior; let's go with the first patch. Jason

[PATCH] Fix PR c++/27100

2016-05-30 Thread Patrick Palka
Here's a more straightforward version of the patch that abuses the fact that the fields DECL_PENDING_INLINE_INFO and DECL_SAVED_FUNCTION_DATA are a union. Bootstrapped + regtested on x86_64-pc-linux-gnu. Does this look OK to commit? gcc/cp/ChangeLog: PR c++/27100 * decl.c (dupli

[PATCH] Fix PR c++/27100

2016-04-16 Thread Patrick Palka
The problem here is that duplicate_decls doesn't preserve the DECL_PENDING_INLINE_P flag of the old decl in the new decl. This happens only when a friend function is defined inside a class and then redeclared. The initial definition sets the DECL_PENDING_INLINE_P flag, but the subsequent redeclar