mirror of git://gcc.gnu.org/git/gcc.git
name-lookup.c (add_decl_to_level): Add decls in an anonymous namespace to static_decls.
* name-lookup.c (add_decl_to_level): Add decls in an anonymous namespace to static_decls. From-SVN: r199906
This commit is contained in:
parent
1c59edccdc
commit
5ee712eb20
|
|
@ -1,3 +1,8 @@
|
||||||
|
2013-06-10 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* name-lookup.c (add_decl_to_level): Add decls in an anonymous
|
||||||
|
namespace to static_decls.
|
||||||
|
|
||||||
2013-06-07 Sriraman Tallam <tmsriram@google.com>
|
2013-06-07 Sriraman Tallam <tmsriram@google.com>
|
||||||
|
|
||||||
PR c++/57548
|
PR c++/57548
|
||||||
|
|
|
||||||
|
|
@ -597,7 +597,9 @@ add_decl_to_level (tree decl, cp_binding_level *b)
|
||||||
if ((VAR_P (decl)
|
if ((VAR_P (decl)
|
||||||
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|
||||||
|| (TREE_CODE (decl) == FUNCTION_DECL
|
|| (TREE_CODE (decl) == FUNCTION_DECL
|
||||||
&& (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl))))
|
&& (!TREE_PUBLIC (decl)
|
||||||
|
|| decl_anon_ns_mem_p (decl)
|
||||||
|
|| DECL_DECLARED_INLINE_P (decl))))
|
||||||
vec_safe_push (b->static_decls, decl);
|
vec_safe_push (b->static_decls, decl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace {
|
||||||
|
void f(); // { dg-message "never defined" }
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
f();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue