public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95180] New: Failure to reject invalid code with attempted redefinition of symbol with different linkage
@ 2020-05-17 20:36 gabravier at gmail dot com
  0 siblings, 0 replies; only message in thread
From: gabravier at gmail dot com @ 2020-05-17 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95180
           Summary: Failure to reject invalid code with attempted
                    redefinition of symbol with different linkage
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

void g(int i)
{
  extern int i;
}

`extern int i;` redefines the `i` parameter and is thus invalid (Clang also
rejects it). This is not warned about by `-std=c++20 -pedantic-errors` so I'll
assume this is a bug, rather than some part of GNU C++. Furthermore, GCC
correctly rejects 

void g(int i)
{
  int i;
}

, so this really looks like a bug to me.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-17 20:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17 20:36 [Bug c++/95180] New: Failure to reject invalid code with attempted redefinition of symbol with different linkage gabravier at gmail dot com

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