public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace
@ 2015-03-25 16:55 trippels at gcc dot gnu.org
  2015-03-25 18:00 ` [Bug c++/65558] [5 Regression] " mpolacek at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-25 16:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558

            Bug ID: 65558
           Summary: crash using __attribute__((__abi_tag__)) on anonymous
                    inline namespace
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
                CC: jason at gcc dot gnu.org

markus@x4 tmp % cat n.ii
inline namespace __attribute__((__abi_tag__)) {}

markus@x4 tmp % g++ -c n.ii
n.ii:1:47: internal compiler error: Segmentation fault
 inline namespace __attribute__((__abi_tag__)) {}
                                               ^
0xcaf40f crash_signal
        ../../gcc/gcc/toplev.c:383
0x7daa72 tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc/gcc/tree.h:2845
0x7daa72 handle_namespace_attrs(tree_node*, tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:3670
0x73867c cp_parser_namespace_definition
        ../../gcc/gcc/cp/parser.c:16247
0x737c69 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:11366
0x737dfa cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:11264
0x73810f cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4100
0x73810f c_parse_file()
        ../../gcc/gcc/cp/parser.c:33193
0x869c12 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1057
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/65558] [5 Regression] crash using __attribute__((__abi_tag__)) on anonymous inline namespace
  2015-03-25 16:55 [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace trippels at gcc dot gnu.org
@ 2015-03-25 18:00 ` mpolacek at gcc dot gnu.org
  2015-03-25 18:07 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-25 18:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
If it is correct to ignore the abi_tag on an anonymous namespace (docs say "The
ABI tags apply to a name..."), then:

--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3663,6 +3663,12 @@ handle_namespace_attrs (tree ns, tree attributes)
                       "namespace", name);
              continue;
            }
+         if (!DECL_NAME (ns))
+           {
+             warning (OPT_Wattributes, "ignoring %qD attribute on anonymous "
+                      "namespace", name);
+             continue;
+           }
          if (!args)
            {
              tree dn = DECL_NAME (ns);


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/65558] [5 Regression] crash using __attribute__((__abi_tag__)) on anonymous inline namespace
  2015-03-25 16:55 [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace trippels at gcc dot gnu.org
  2015-03-25 18:00 ` [Bug c++/65558] [5 Regression] " mpolacek at gcc dot gnu.org
@ 2015-03-25 18:07 ` redi at gcc dot gnu.org
  2015-03-25 18:13 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-25 18:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #2)
> If it is correct to ignore the abi_tag on an anonymous namespace

It's correct, anything in an anon namespace cannot be named outside the current
translation unit, so there's no point changing its mangling or warning about
what happens when it's used by another TU.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/65558] [5 Regression] crash using __attribute__((__abi_tag__)) on anonymous inline namespace
  2015-03-25 16:55 [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace trippels at gcc dot gnu.org
  2015-03-25 18:00 ` [Bug c++/65558] [5 Regression] " mpolacek at gcc dot gnu.org
  2015-03-25 18:07 ` redi at gcc dot gnu.org
@ 2015-03-25 18:13 ` mpolacek at gcc dot gnu.org
  2015-03-25 19:24 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-25 18:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine then.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/65558] [5 Regression] crash using __attribute__((__abi_tag__)) on anonymous inline namespace
  2015-03-25 16:55 [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace trippels at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-25 18:13 ` mpolacek at gcc dot gnu.org
@ 2015-03-25 19:24 ` jason at gcc dot gnu.org
  2015-03-25 20:38 ` mpolacek at gcc dot gnu.org
  2015-03-25 21:19 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-25 19:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
That patch is OK.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/65558] [5 Regression] crash using __attribute__((__abi_tag__)) on anonymous inline namespace
  2015-03-25 16:55 [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace trippels at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-03-25 19:24 ` jason at gcc dot gnu.org
@ 2015-03-25 20:38 ` mpolacek at gcc dot gnu.org
  2015-03-25 21:19 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-25 20:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Mar 25 20:08:05 2015
New Revision: 221672

URL: https://gcc.gnu.org/viewcvs?rev=221672&root=gcc&view=rev
Log:
    PR c++/65558
    * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
    on an anonymous namespace.

    * g++.dg/cpp0x/pr65558.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr65558.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/65558] [5 Regression] crash using __attribute__((__abi_tag__)) on anonymous inline namespace
  2015-03-25 16:55 [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace trippels at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-03-25 20:38 ` mpolacek at gcc dot gnu.org
@ 2015-03-25 21:19 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-25 21:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-25 20:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 16:55 [Bug c++/65558] New: crash using __attribute__((__abi_tag__)) on anonymous inline namespace trippels at gcc dot gnu.org
2015-03-25 18:00 ` [Bug c++/65558] [5 Regression] " mpolacek at gcc dot gnu.org
2015-03-25 18:07 ` redi at gcc dot gnu.org
2015-03-25 18:13 ` mpolacek at gcc dot gnu.org
2015-03-25 19:24 ` jason at gcc dot gnu.org
2015-03-25 20:38 ` mpolacek at gcc dot gnu.org
2015-03-25 21:19 ` mpolacek at gcc dot gnu.org

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).