Skip to content
Snippets Groups Projects
Commit c1a53d9d authored by Nathaniel Shead's avatar Nathaniel Shead
Browse files

c++/modules: Disable streaming definitions of non-vague-linkage GMF decls [PR115020]


The error in the linked PR is caused because 'DECL_THIS_STATIC' is true
for the static member function, causing the streaming code to assume
that this is an internal linkage GM entity that needs to be explicitly
streamed, which then on read-in gets marked as a vague linkage function
(despite being non-inline) causing import_export_decl to complain.

However, I don't see any reason why we should care about this:
definitions in the GMF should just be emitted as per usual regardless of
whether they're internal-linkage or not.  Actually the only thing we
care about here are header modules, since they have no TU to write
definitions into.  As such this patch removes these conditions from
'has_definition' and updates some comments to clarify.

	PR c++/115020

gcc/cp/ChangeLog:

	* module.cc (has_definition): Only force writing definitions for
	header_module_p.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/pr115020_a.C: New test.
	* g++.dg/modules/pr115020_b.C: New test.

Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: default avatarJason Merrill <jason@redhat.com>
parent 6f115a8e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment