public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/27884]  New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification
@ 2006-06-03 17:12 tbm at cyrius dot com
  2006-06-03 17:19 ` [Bug debug/27884] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2006-06-03 17:12 UTC (permalink / raw)
  To: gcc-bugs

Between 20060508 and 20060530 gcc 4.2 changed to now longer allow the following
code.  This error seems bogus to me.

(sid)3733:tbm@test: ~] cat test.cc
extern "C" void foo(register int *my_perl);
(sid)3734:tbm@test: ~] c++ -c test.cc
test.cc:1: error: invalid use of 'register' in linkage specification
zsh: exit 1     c++ -c test.cc
(sid)3735:tbm@test: ~]


-- 
           Summary: [4.2 regression] bogus error: invalid use of 'register'
                    in linkage specification
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


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


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

* [Bug debug/27884] [4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
@ 2006-06-03 17:19 ` pinskia at gcc dot gnu dot org
  2006-06-04 10:04 ` [Bug c++/27884] " rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-03 17:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-06-03 17:18 -------
I want to say the patch for PR 26068 caused this.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
  BugsThisDependsOn|                            |26068
   Target Milestone|---                         |4.2.0


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


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

* [Bug c++/27884] [4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
  2006-06-03 17:19 ` [Bug debug/27884] " pinskia at gcc dot gnu dot org
@ 2006-06-04 10:04 ` rguenth at gcc dot gnu dot org
  2006-06-04 10:24 ` tbm at cyrius dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-06-04 10:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-06-04 10:04 -------
It's certainly a questionable use of 'register'.  What is the expected effect
of this parameter declaration from perls point of view?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c++/27884] [4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
  2006-06-03 17:19 ` [Bug debug/27884] " pinskia at gcc dot gnu dot org
  2006-06-04 10:04 ` [Bug c++/27884] " rguenth at gcc dot gnu dot org
@ 2006-06-04 10:24 ` tbm at cyrius dot com
  2006-06-04 10:48 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2006-06-04 10:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tbm at cyrius dot com  2006-06-04 10:24 -------
I don't know why Perl uses it, I simply noticed that lots of packages in Debian
now fail to build because its part of a Perl header... they do this:

extern "C" SV* Perl_Gsv_placeholder_ptr(register PerlInterpreter *my_perl
__attribute__((unused)));

In an IRC discussion whether this is valid, the following comments were made:

18:11 < Womble2> "a linkage-specification directly containing a single
declaration shall not specify a storage class"  (7.5/8)
18:12 < Womble2> but I think it really means at the top-level of the
declaration
18:12 < pinskia> Womble2: I think that means extern "C" static int t; is
invalid
18:12 < Womble2> yes the example it gives has a function declared a static
18:13 < pinskia> but register allows to the argument and not to the declaration
18:13 < pinskia> s/allows/applies/
18:14 < Womble2> indeed, though the statement could be (rather perversely) read
as disallow specification of a storage class anywhere in the declaration, as
the person who made the change may have done
[Womble2 = Ben Hutchings, pinskia = Andrew Pinski]

Do you disagree with that interpretation?


-- 


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


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

* [Bug c++/27884] [4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (2 preceding siblings ...)
  2006-06-04 10:24 ` tbm at cyrius dot com
@ 2006-06-04 10:48 ` rguenth at gcc dot gnu dot org
  2006-06-04 10:52 ` tbm at cyrius dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-06-04 10:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2006-06-04 10:48 -------
I agree that the code is valid from a standards perspective.  Just not very
clever ;)


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid


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


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

* [Bug c++/27884] [4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (3 preceding siblings ...)
  2006-06-04 10:48 ` rguenth at gcc dot gnu dot org
@ 2006-06-04 10:52 ` tbm at cyrius dot com
  2006-06-04 15:35 ` [Bug c++/27884] [4.1/4.2 " rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2006-06-04 10:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tbm at cyrius dot com  2006-06-04 10:52 -------
OK, I'll let the Perl people know.  It would be nice though to revert this
error before 4.1.2/4.2.0 come out.


-- 


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


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

* [Bug c++/27884] [4.1/4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (4 preceding siblings ...)
  2006-06-04 10:52 ` tbm at cyrius dot com
@ 2006-06-04 15:35 ` rguenth at gcc dot gnu dot org
  2006-06-04 19:51 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-06-04 15:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2006-06-04 15:35 -------
Confirmed.  Breaking perl is not nice.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |blocker
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-06-04 15:35:07
               date|                            |
            Summary|[4.2 regression] bogus      |[4.1/4.2 regression] bogus
                   |error: invalid use of       |error: invalid use of
                   |'register' in linkage       |'register' in linkage
                   |specification               |specification
   Target Milestone|4.2.0                       |4.1.2


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


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

* [Bug c++/27884] [4.1/4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (5 preceding siblings ...)
  2006-06-04 15:35 ` [Bug c++/27884] [4.1/4.2 " rguenth at gcc dot gnu dot org
@ 2006-06-04 19:51 ` mmitchel at gcc dot gnu dot org
  2006-06-16  7:15 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-04 19:51 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c++/27884] [4.1/4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (6 preceding siblings ...)
  2006-06-04 19:51 ` mmitchel at gcc dot gnu dot org
@ 2006-06-16  7:15 ` mmitchel at gcc dot gnu dot org
  2006-06-16 18:53 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-16  7:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/27884] [4.1/4.2 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (7 preceding siblings ...)
  2006-06-16  7:15 ` mmitchel at gcc dot gnu dot org
@ 2006-06-16 18:53 ` mmitchel at gcc dot gnu dot org
  2006-06-16 18:59 ` [Bug c++/27884] [4.1 " mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-16 18:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mmitchel at gcc dot gnu dot org  2006-06-16 18:46 -------
Subject: Bug 27884

Author: mmitchel
Date: Fri Jun 16 18:45:50 2006
New Revision: 114727

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114727
Log:
        PR c++/27884
        * decl.c (have_extern_spec): Remove.
        (start_decl): Do not check have_extern_spec.
        (start_function): Likewise.
        * cp-tree.h (have_extern_spec): Remove.
        * parser.c (cp_parser_linkage_specification): Don't set
        have_extern_spec.
        (cp_parser_init_declarator): Likewise.
        (cp_parser_parameter_declaration): Do not treat parameters as
        within the scope of an unbraced linkage specification.
        PR c++/27884
        * g++.dg/parse/linkage2.C: New test

Added:
    trunk/gcc/testsuite/g++.dg/parse/linkage2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/27884] [4.1 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (8 preceding siblings ...)
  2006-06-16 18:53 ` mmitchel at gcc dot gnu dot org
@ 2006-06-16 18:59 ` mmitchel at gcc dot gnu dot org
  2006-06-16 23:10 ` mmitchel at gcc dot gnu dot org
  2006-06-16 23:12 ` mmitchel at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-16 18:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mmitchel at gcc dot gnu dot org  2006-06-16 18:53 -------
Fixed in 4.2.0.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 regression] bogus  |[4.1 regression] bogus
                   |error: invalid use of       |error: invalid use of
                   |'register' in linkage       |'register' in linkage
                   |specification               |specification


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


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

* [Bug c++/27884] [4.1 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (9 preceding siblings ...)
  2006-06-16 18:59 ` [Bug c++/27884] [4.1 " mmitchel at gcc dot gnu dot org
@ 2006-06-16 23:10 ` mmitchel at gcc dot gnu dot org
  2006-06-16 23:12 ` mmitchel at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-16 23:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mmitchel at gcc dot gnu dot org  2006-06-16 23:09 -------
Subject: Bug 27884

Author: mmitchel
Date: Fri Jun 16 23:09:23 2006
New Revision: 114731

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114731
Log:
        PR c++/27884
        * decl.c (have_extern_spec): Remove.
        (start_decl): Do not check have_extern_spec.
        (start_function): Likewise.
        * cp-tree.h (have_extern_spec): Remove.
        * parser.c (cp_parser_linkage_specification): Don't set
        have_extern_spec.
        (cp_parser_init_declarator): Likewise.
        (cp_parser_parameter_declaration): Do not treat parameters as
        within the scope of an unbraced linkage specification.
        PR c++/27884
        * g++.dg/parse/linkage2.C: New test

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/linkage2.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/cp-tree.h
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/cp/parser.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/27884] [4.1 regression] bogus error: invalid use of 'register' in linkage specification
  2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
                   ` (10 preceding siblings ...)
  2006-06-16 23:10 ` mmitchel at gcc dot gnu dot org
@ 2006-06-16 23:12 ` mmitchel at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-16 23:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from mmitchel at gcc dot gnu dot org  2006-06-16 23:09 -------
Fixed in 4.1.2.


-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-06-16 23:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-03 17:12 [Bug debug/27884] New: [4.2 regression] bogus error: invalid use of 'register' in linkage specification tbm at cyrius dot com
2006-06-03 17:19 ` [Bug debug/27884] " pinskia at gcc dot gnu dot org
2006-06-04 10:04 ` [Bug c++/27884] " rguenth at gcc dot gnu dot org
2006-06-04 10:24 ` tbm at cyrius dot com
2006-06-04 10:48 ` rguenth at gcc dot gnu dot org
2006-06-04 10:52 ` tbm at cyrius dot com
2006-06-04 15:35 ` [Bug c++/27884] [4.1/4.2 " rguenth at gcc dot gnu dot org
2006-06-04 19:51 ` mmitchel at gcc dot gnu dot org
2006-06-16  7:15 ` mmitchel at gcc dot gnu dot org
2006-06-16 18:53 ` mmitchel at gcc dot gnu dot org
2006-06-16 18:59 ` [Bug c++/27884] [4.1 " mmitchel at gcc dot gnu dot org
2006-06-16 23:10 ` mmitchel at gcc dot gnu dot org
2006-06-16 23:12 ` mmitchel at gcc dot gnu dot 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).