public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "akim.demaille at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58724] New: doc: use of attributes for namespace is not clear
Date: Mon, 14 Oct 2013 15:20:00 -0000	[thread overview]
Message-ID: <bug-58724-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58724

            Bug ID: 58724
           Summary: doc: use of attributes for namespace is not clear
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: akim.demaille at gmail dot com

Hi friends,

I could not find an example of a use of the attributes for namespaces.  It is
mentioned in the text body, but there is no example of the syntax (it appears
for the documentation of "visibility" in
http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/Function-Attributes.html#Function-Attributes).
 Also, it does not appear in the node dedicated to C++ attributes
(http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/C_002b_002b-Attributes.html#C_002b_002b-Attributes).

Also, it might be worth noting (in the doc) that the __attribute__ syntax is
supported, but not [[...]].  I have no idea if this is meant.  4.8 issues a
weird error message, 4.9 ices.

$ cat foo.cc
namespace foo __attribute__((visibility("default"))) {}
namespace bar [[gnu::visibility("default")]] {}
$ g++-mp-4.8 -std=c++1y foo.cc -c
foo.cc:2:46: warning: '#'tree_list' not supported by dump_decl#<declaration
error>' attribute directive ignored [-Wattributes]
 namespace bar [[gnu::visibility("default")]] {}
                                              ^
$ g++-mp-4.9 -std=c++1y foo.cc -c
foo.cc:2:46: internal compiler error: tree check: expected identifier_node,
have tree_list in private_is_attribute_p, at tree.c:5558
 namespace bar [[gnu::visibility("default")]] {}
                                              ^

foo.cc:2:46: internal compiler error: Abort trap: 6
g++-mp-4.9: internal compiler error: Abort trap: 6 (program cc1plus)
zsh: abort      g++-mp-4.9 -std=c++1y foo.cc -c
$ g++-mp-4.9 --version                                          13
g++-mp-4.9 (MacPorts gcc49 4.9-20130915_0) 4.9.0 20130915 (experimental)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


             reply	other threads:[~2013-10-14 15:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 15:20 akim.demaille at gmail dot com [this message]
2013-10-14 15:54 ` [Bug c++/58724] " paolo.carlini at oracle dot com
2013-10-14 15:57 ` akim.demaille at gmail dot com
2013-10-14 16:01 ` paolo.carlini at oracle dot com
2013-10-14 16:03 ` paolo.carlini at oracle dot com
2013-10-14 16:17 ` [Bug c++/58724] ICE with attribute [[gnu::visibility("default")]] on namespace paolo.carlini at oracle dot com
2013-10-16  9:13 ` paolo.carlini at oracle dot com
2013-10-23  0:16 ` paolo.carlini at oracle dot com
2013-11-05 15:24 ` paolo at gcc dot gnu.org
2013-11-05 15:26 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-58724-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).