Re: [PATCH] PR c++/91476 - anon-namespace reference temp clash between TUs.

2020-01-21 Thread Jason Merrill
On 1/21/20 10:17 AM, Jason Merrill wrote: The problem in the PR was that make_temporary_var_for_ref_to_temp ran before determine_visibility, so when we copied the linkage of the reference variable it had not yet been restricted by its anonymous namespace context, so the temporary wrongly ended up

[PATCH] PR c++/91476 - anon-namespace reference temp clash between TUs.

2020-01-21 Thread Jason Merrill
The problem in the PR was that make_temporary_var_for_ref_to_temp ran before determine_visibility, so when we copied the linkage of the reference variable it had not yet been restricted by its anonymous namespace context, so the temporary wrongly ended up with TREE_PUBLIC set. The natural solution