public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered
@ 2022-03-29 17:24 vanyacpp at gmail dot com
  2022-03-30  9:35 ` [Bug c++/105099] In lookup of " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vanyacpp at gmail dot com @ 2022-03-29 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105099
           Summary: In lookup for namespace name qualifiers only
                    namespaces should be considered
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vanyacpp at gmail dot com
  Target Milestone: ---

Consider this code:

namespace a
{
    namespace c
    {}

    struct a
    {};

    namespace b = a::c;   // (1)
    using namespace a::c; // (2)
}

Currently GCC prints an error:

file.cpp:9:22: error: 'c' is not a namespace-name
    9 |     namespace b = a::c;
      |                      ^
file.cpp:10:24: error: 'c' is not a namespace-name
   10 |     using namespace a::c;
      |                        ^

If I interpret the standard correctly the code should compile without errors
because during the lookup of the qualifier the struct "a" should be ignored and
the namespace "a" should be found.

[basic.lookup.udir]p1: In a using-directive or namespace-alias-definition,
during the lookup for a namespace-name or for a name in a nested-name-specifier
only namespace names are considered.

https://eel.is/c++draft/basic.lookup.udir
https://godbolt.org/z/vaWjx4cKj

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

* [Bug c++/105099] In lookup of namespace name qualifiers only namespaces should be considered
  2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
@ 2022-03-30  9:35 ` redi at gcc dot gnu.org
  2022-03-30  9:38 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-30  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-03-30
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
That wording was clarified by CWG 373:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#373

The issue says that G++ compiles the following:

namespace X {
  namespace Y {
    struct X {
      void f()
      {
        using namespace X::Y;
        namespace Z = X::Y;
      }
    };
  }
}

However, I can't find any version of G++ that accepts it!

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

* [Bug c++/105099] In lookup of namespace name qualifiers only namespaces should be considered
  2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
  2022-03-30  9:35 ` [Bug c++/105099] In lookup of " redi at gcc dot gnu.org
@ 2022-03-30  9:38 ` redi at gcc dot gnu.org
  2022-03-30 12:02 ` [Bug c++/105099] [9/10/11/12 Regression] " redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-30  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Based on the issue submission date, Clark was probably talking about GCC 3.1 or
similar. So maybe this is a regression since the new C++ parser was introduced.

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

* [Bug c++/105099] [9/10/11/12 Regression] In lookup of namespace name qualifiers only namespaces should be considered
  2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
  2022-03-30  9:35 ` [Bug c++/105099] In lookup of " redi at gcc dot gnu.org
  2022-03-30  9:38 ` redi at gcc dot gnu.org
@ 2022-03-30 12:02 ` redi at gcc dot gnu.org
  2022-04-04 11:33 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-30 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.3.1, 11.2.1, 12.0,
                   |                            |4.1.2, 9.4.1
            Summary|In lookup of namespace name |[9/10/11/12 Regression] In
                   |qualifiers only namespaces  |lookup of namespace name
                   |should be considered        |qualifiers only namespaces
                   |                            |should be considered
      Known to work|                            |3.2.3

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It compiles with GCC 3.2.3, so marking as a regression. My guess is it broke
with the new parser in 3.4 but I haven't confirmed it.

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

* [Bug c++/105099] [9/10/11/12 Regression] In lookup of namespace name qualifiers only namespaces should be considered
  2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
                   ` (2 preceding siblings ...)
  2022-03-30 12:02 ` [Bug c++/105099] [9/10/11/12 Regression] " redi at gcc dot gnu.org
@ 2022-04-04 11:33 ` rguenth at gcc dot gnu.org
  2022-05-27  9:47 ` [Bug c++/105099] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-04 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
   Target Milestone|---                         |9.5

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

* [Bug c++/105099] [10/11/12/13 Regression] In lookup of namespace name qualifiers only namespaces should be considered
  2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
                   ` (3 preceding siblings ...)
  2022-04-04 11:33 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:47 ` rguenth at gcc dot gnu.org
  2022-06-28 10:48 ` jakub at gcc dot gnu.org
  2023-07-07 10:42 ` [Bug c++/105099] [11/12/13/14 " rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

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

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

* [Bug c++/105099] [10/11/12/13 Regression] In lookup of namespace name qualifiers only namespaces should be considered
  2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
                   ` (4 preceding siblings ...)
  2022-05-27  9:47 ` [Bug c++/105099] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:48 ` jakub at gcc dot gnu.org
  2023-07-07 10:42 ` [Bug c++/105099] [11/12/13/14 " rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug c++/105099] [11/12/13/14 Regression] In lookup of namespace name qualifiers only namespaces should be considered
  2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
                   ` (5 preceding siblings ...)
  2022-06-28 10:48 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:42 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2023-07-07 10:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 17:24 [Bug c++/105099] New: In lookup for namespace name qualifiers only namespaces should be considered vanyacpp at gmail dot com
2022-03-30  9:35 ` [Bug c++/105099] In lookup of " redi at gcc dot gnu.org
2022-03-30  9:38 ` redi at gcc dot gnu.org
2022-03-30 12:02 ` [Bug c++/105099] [9/10/11/12 Regression] " redi at gcc dot gnu.org
2022-04-04 11:33 ` rguenth at gcc dot gnu.org
2022-05-27  9:47 ` [Bug c++/105099] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:48 ` jakub at gcc dot gnu.org
2023-07-07 10:42 ` [Bug c++/105099] [11/12/13/14 " 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).