mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
c++: visibility of instantiated template friends
In 20_util/variant/visit_member.cc, instantiation of the variant friend declaration of __get for variant<test01()::X> was being marked as internal because that variant specialization is itself internal. And therefore check_module_override didn't try to merge it with the non-exported namespace-scope declaration of __get. But the template parms of variant are not part of the friend template's identity, so they should not affect its visibility. If they are substituted into the friend declaration, we'll handle that when looking at the declaration itself. This change no longer seems necessary to fix the testcase, but does still seem correct. We definitely still get here during tsubst_friend_function. gcc/cp/ChangeLog: * decl2.cc (determine_visibility): Ignore args for friend templates.
This commit is contained in:
@@ -3160,7 +3160,9 @@ determine_visibility (tree decl)
|
||||
&& !attr)
|
||||
{
|
||||
int depth = TMPL_ARGS_DEPTH (args);
|
||||
if (DECL_VISIBILITY_SPECIFIED (decl))
|
||||
if (DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P (TI_TEMPLATE (tinfo)))
|
||||
/* Class template args don't affect template friends. */;
|
||||
else if (DECL_VISIBILITY_SPECIFIED (decl))
|
||||
{
|
||||
/* A class template member with explicit visibility
|
||||
overrides the class visibility, so we need to apply
|
||||
|
||||
Reference in New Issue
Block a user