c++/modules: Support section attributes [PR122786]

This is a minimal fix to not just silently drop the section attribute on
stream-in.  Ideally we should be using cplus_decl_attributes for this,
but it's not yet ready for modules (many attributes behave weirdly when
applied not during parsing).  We should also be checking for
incompatible sections on stream-in in is_matching_decl, but that would
also be better handled more generally so I'm leaving that out of this
patch.

Instead this minimally fixes the issue by just re-applying the section
name from the attributes we've streamed in.

	PR c++/122786

gcc/cp/ChangeLog:

	* module.cc (trees_in::decl_value): Set section name from
	attribute.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/attrib-5_a.C: New test.
	* g++.dg/modules/attrib-5_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
3 files changed