Commit 33b5d6da by Paolo Carlini

re PR c++/58724 (ICE with attribute [[gnu::visibility("default")]] on namespace)

2013-11-05  Paolo Carlini  <paolo.carlini@oracle.com>
	
	PR c++/58724
	* doc/extend.texi [visibility ("visibility_type")]: Add example
	about visibility attribute on namespace declaration.

/cp
2013-11-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58724
	* name-lookup.c (handle_namespace_attrs): Use get_attribute_name.

/testsuite
2013-11-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58724
	* g++.dg/cpp0x/gen-attrs-56.C: New.

From-SVN: r204401
parent 9c39fca1
2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58724
* doc/extend.texi [visibility ("visibility_type")]: Add example
about visibility attribute on namespace declaration.
2013-11-05 Richard Biener <rguenther@suse.de> 2013-11-05 Richard Biener <rguenther@suse.de>
PR ipa/58492 PR ipa/58492
...@@ -27,7 +33,7 @@ ...@@ -27,7 +33,7 @@
2013-11-05 Andrew MacLeod <amacleod@redhat.com> 2013-11-05 Andrew MacLeod <amacleod@redhat.com>
* tree-outof-ssa.c (queue_phi_copy_p): Combine phi_ssa_name_p from * tree-outof-ssa.c (queue_phi_copy_p): Combine phi_ssa_name_p from
gimple.h and the rest of the condition in eliminate_build. gimple.h and the rest of the condition in eliminate_build.
(eliminate_build): Call new routine. (eliminate_build): Call new routine.
* gimple.h (phi_ssa_name_p): Delete. * gimple.h (phi_ssa_name_p): Delete.
2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58724
* name-lookup.c (handle_namespace_attrs): Use get_attribute_name.
2013-11-05 Tobias Burnus <burnus@net-b.de> 2013-11-05 Tobias Burnus <burnus@net-b.de>
* parser.c (cp_parser_omp_for, cp_parser_omp_parallel, * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
......
...@@ -3571,7 +3571,7 @@ handle_namespace_attrs (tree ns, tree attributes) ...@@ -3571,7 +3571,7 @@ handle_namespace_attrs (tree ns, tree attributes)
for (d = attributes; d; d = TREE_CHAIN (d)) for (d = attributes; d; d = TREE_CHAIN (d))
{ {
tree name = TREE_PURPOSE (d); tree name = get_attribute_name (d);
tree args = TREE_VALUE (d); tree args = TREE_VALUE (d);
if (is_attribute_p ("visibility", name)) if (is_attribute_p ("visibility", name))
......
...@@ -4275,6 +4275,12 @@ the One Definition Rule; for example, it is usually not useful to mark ...@@ -4275,6 +4275,12 @@ the One Definition Rule; for example, it is usually not useful to mark
an inline method as hidden without marking the whole class as hidden. an inline method as hidden without marking the whole class as hidden.
A C++ namespace declaration can also have the visibility attribute. A C++ namespace declaration can also have the visibility attribute.
@smallexample
namespace nspace1 __attribute__ ((visibility ("protected")))
@{ /* @r{Do something.} */; @}
@end smallexample
This attribute applies only to the particular namespace body, not to This attribute applies only to the particular namespace body, not to
other definitions of the same namespace; it is equivalent to using other definitions of the same namespace; it is equivalent to using
@samp{#pragma GCC visibility} before and after the namespace @samp{#pragma GCC visibility} before and after the namespace
......
2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58724
* g++.dg/cpp0x/gen-attrs-56.C: New.
2013-11-05 Richard Biener <rguenther@suse.de> 2013-11-05 Richard Biener <rguenther@suse.de>
PR ipa/58492 PR ipa/58492
......
// PR c++/58724
// { dg-do compile { target c++11 } }
namespace foo __attribute__((visibility("default"))) {}
namespace bar [[gnu::visibility("default")]] {}
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