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

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