Commit 8f0db566 by Jason Merrill Committed by Jason Merrill

PR c++/78749 - friend in anonymous namespace

	* decl.c (wrapup_globals_for_namespace): Don't complain about friend
	pseudo-template instantiations.

From-SVN: r243862
parent d697acca
2016-12-21 Jason Merrill <jason@redhat.com>
PR c++/78749 - friend in anonymous namespace
* decl.c (wrapup_globals_for_namespace): Don't complain about friend
pseudo-template instantiations.
2016-12-16 Richard Biener <rguenther@suse.de>
PR c++/71694
......
......@@ -926,6 +926,7 @@ wrapup_globals_for_namespace (tree name_space, void* data ATTRIBUTE_UNUSED)
&& DECL_EXTERNAL (decl)
&& !TREE_PUBLIC (decl)
&& !DECL_ARTIFICIAL (decl)
&& !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)
&& !TREE_NO_WARNING (decl))
{
warning_at (DECL_SOURCE_LOCATION (decl),
......
// { dg-options -Wunused-function }
namespace
{
template <class T> struct A
{
friend void f(A) { }
};
A<int> a;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment