public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32042]  New: linkage confused with scope?
@ 2007-05-22 14:56 andrew dot stubbs at st dot com
  2007-05-24  2:12 ` [Bug c++/32042] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 5+ messages in thread
From: andrew dot stubbs at st dot com @ 2007-05-22 14:56 UTC (permalink / raw)
  To: gcc-bugs

The following code defines the same external function twice, once with C++
linkage, and once with C linkage. GCC 4.1.1 does not complain.

void
foo ()
{
  extern int f(int);
}

extern "C" int f(int i);  // conflict

However, the following example is properly rejected:

extern int f(int);
extern "C" int f(int i);  // conflict

EDG rejects both examples.

It would appear that the only difference is that the C++ function is not
visible in the scope when the C function is defined, but they can't both have
external linkage.


-- 
           Summary: linkage confused with scope?
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


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


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

* [Bug c++/32042] linkage confused with scope?
  2007-05-22 14:56 [Bug c++/32042] New: linkage confused with scope? andrew dot stubbs at st dot com
@ 2007-05-24  2:12 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-24  2:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-05-24 03:11 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid
      Known to fail|                            |4.3.0 4.1.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-24 03:11:53
               date|                            |


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


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

* [Bug c++/32042] linkage confused with scope?
       [not found] <bug-32042-4@http.gcc.gnu.org/bugzilla/>
  2021-08-26 20:38 ` pinskia at gcc dot gnu.org
  2021-08-26 22:16 ` pinskia at gcc dot gnu.org
@ 2021-12-04  8:12 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-04  8:12 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

* [Bug c++/32042] linkage confused with scope?
       [not found] <bug-32042-4@http.gcc.gnu.org/bugzilla/>
  2021-08-26 20:38 ` pinskia at gcc dot gnu.org
@ 2021-08-26 22:16 ` pinskia at gcc dot gnu.org
  2021-12-04  8:12 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-26 22:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Was fixed by r11-3699.

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

* [Bug c++/32042] linkage confused with scope?
       [not found] <bug-32042-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-26 20:38 ` pinskia at gcc dot gnu.org
  2021-08-26 22:16 ` pinskia at gcc dot gnu.org
  2021-12-04  8:12 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-26 20:38 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.1.0

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Seems fixed for GCC 11.

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

end of thread, other threads:[~2021-12-04  8:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-22 14:56 [Bug c++/32042] New: linkage confused with scope? andrew dot stubbs at st dot com
2007-05-24  2:12 ` [Bug c++/32042] " pinskia at gcc dot gnu dot org
     [not found] <bug-32042-4@http.gcc.gnu.org/bugzilla/>
2021-08-26 20:38 ` pinskia at gcc dot gnu.org
2021-08-26 22:16 ` pinskia at gcc dot gnu.org
2021-12-04  8:12 ` pinskia 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).