Skip to content
Snippets Groups Projects
Commit f50f603c authored by Patrick Palka's avatar Patrick Palka
Browse files

c++: bogus warning w/ deduction guide in anon ns [PR106604]


Here we're unintentionally issuing a "declared static but never defined"
warning from wrapup_namespace_globals for a deduction guide declared in
an anonymous namespace.  This patch fixes this by giving deduction guides
a dummy DECL_INITIAL, which suppresses the warning and also allows us to
simplify redeclaration checking for them.

Co-authored-by: default avatarJason Merrill <jason@redhat.com>

	PR c++/106604

gcc/cp/ChangeLog:

	* decl.cc (redeclaration_error_message): Remove special handling
	for deduction guides.
	(grokfndecl): Give deduction guides a dummy DECL_INITIAL.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1z/class-deduction74.C: Expect "defined" instead
	of "declared" in the repeated deduction guide diagnostics.
	* g++.dg/cpp1z/class-deduction116.C: New test.
parent 066c260a
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