public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109621] New: GCC accepts invalid program with multiple using declarations
@ 2023-04-25 10:05 jlame646 at gmail dot com
  2023-04-25 15:29 ` [Bug c++/109621] [10/11/12/13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jlame646 at gmail dot com @ 2023-04-25 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109621
           Summary: GCC accepts invalid program with multiple using
                    declarations
           Product: gcc
           Version: 13.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following invalid program(afaik) is accepted by gcc and msvc.
https://godbolt.org/z/1Tsx54ro5

```
namespace X 
{ 
    struct type {}; 
}
namespace Y 
{ 
    using type = int; 
}
using X::type;
using Y::type;
int main()
{
    auto i = sizeof(type); //gcc and msvc accepts this but clang rejects this
}
```

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

* [Bug c++/109621] [10/11/12/13/14 Regression] GCC accepts invalid program with multiple using declarations
  2023-04-25 10:05 [Bug c++/109621] New: GCC accepts invalid program with multiple using declarations jlame646 at gmail dot com
@ 2023-04-25 15:29 ` pinskia at gcc dot gnu.org
  2023-04-25 17:24 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-25 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|GCC accepts invalid program |[10/11/12/13/14 Regression]
                   |with multiple using         |GCC accepts invalid program
                   |declarations                |with multiple using
                   |                            |declarations
      Known to fail|                            |4.4.7
   Target Milestone|---                         |10.5
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.1.2
   Last reconfirmed|                            |2023-04-25

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
C++98 version which shows it is a regression and it started to fail between GCC
4.1.2 and 4.4.7:
```
namespace X 
{ 
    struct type {}; 
}
namespace Y 
{ 
    typedef int type;
}
using Y::type;
using X::type;
int i = sizeof(type); //gcc and msvc accepts this but clang rejects this

```

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

* [Bug c++/109621] [10/11/12/13/14 Regression] GCC accepts invalid program with multiple using declarations
  2023-04-25 10:05 [Bug c++/109621] New: GCC accepts invalid program with multiple using declarations jlame646 at gmail dot com
  2023-04-25 15:29 ` [Bug c++/109621] [10/11/12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2023-04-25 17:24 ` redi at gcc dot gnu.org
  2023-04-25 17:25 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-04-25 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Possibly started with 

    re PR c++/31749 (ICE with invalid redeclaration of builtin)

            PR c++/31749

            gcc/cp/
            * name-lookup.c (do_nonmember_using_decl): Shift implicit type
            declarations into appropriate slots for comparison.  Fix type
            comparison.

            gcc/testsuite/
            * g++.dg/lookup/builtin3.C: New test.
            * g++.dg/lookup/builtin4.C: New test.
            * g++.dg/lookup/using19.C: New test.

    From-SVN: r127600

Or something before that and after r127526.

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

* [Bug c++/109621] [10/11/12/13/14 Regression] GCC accepts invalid program with multiple using declarations
  2023-04-25 10:05 [Bug c++/109621] New: GCC accepts invalid program with multiple using declarations jlame646 at gmail dot com
  2023-04-25 15:29 ` [Bug c++/109621] [10/11/12/13/14 Regression] " pinskia at gcc dot gnu.org
  2023-04-25 17:24 ` redi at gcc dot gnu.org
@ 2023-04-25 17:25 ` redi at gcc dot gnu.org
  2023-07-07 10:45 ` [Bug c++/109621] [11/12/13/14 " rguenth at gcc dot gnu.org
  2024-01-12 10:36 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-04-25 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Which makes it a regression in 4.3.0 and later.

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

* [Bug c++/109621] [11/12/13/14 Regression] GCC accepts invalid program with multiple using declarations
  2023-04-25 10:05 [Bug c++/109621] New: GCC accepts invalid program with multiple using declarations jlame646 at gmail dot com
                   ` (2 preceding siblings ...)
  2023-04-25 17:25 ` redi at gcc dot gnu.org
@ 2023-07-07 10:45 ` rguenth at gcc dot gnu.org
  2024-01-12 10:36 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug c++/109621] [11/12/13/14 Regression] GCC accepts invalid program with multiple using declarations
  2023-04-25 10:05 [Bug c++/109621] New: GCC accepts invalid program with multiple using declarations jlame646 at gmail dot com
                   ` (3 preceding siblings ...)
  2023-07-07 10:45 ` [Bug c++/109621] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-01-12 10:36 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-12 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

end of thread, other threads:[~2024-01-12 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-25 10:05 [Bug c++/109621] New: GCC accepts invalid program with multiple using declarations jlame646 at gmail dot com
2023-04-25 15:29 ` [Bug c++/109621] [10/11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-04-25 17:24 ` redi at gcc dot gnu.org
2023-04-25 17:25 ` redi at gcc dot gnu.org
2023-07-07 10:45 ` [Bug c++/109621] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-01-12 10:36 ` rguenth 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).