public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111841] New: Lookup context rejected at definition if lookup finds a namespace
@ 2023-10-17  0:40 johelegp at gmail dot com
  2023-10-17  0:47 ` [Bug c++/111841] " johelegp at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: johelegp at gmail dot com @ 2023-10-17  0:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111841
           Summary: Lookup context rejected at definition if lookup finds
                    a namespace
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
                CC: johelegp at gmail dot com
  Target Milestone: ---

See <https://compiler-explorer.com/z/K8afMEbsr>.

```C++
namespace ns { }
struct X {
  struct ns { void f(); };
  struct t : ns { };
};
void g() {
  [](auto x) {
      return x.ns::f();
  }
  // (X::t{}) // Clang and MSVC accept.
  ;
}
```

```output
<source>: In lambda function:
<source>:8:16: error: 'ns::f' is not a class member
    8 |       return x.ns::f();
      |                ^~
Compiler returned: 1
```

This goes back to GCC 4.9.4: <https://compiler-explorer.com/z/17bxK94rT>.

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

* [Bug c++/111841] Lookup context rejected at definition if lookup finds a namespace
  2023-10-17  0:40 [Bug c++/111841] New: Lookup context rejected at definition if lookup finds a namespace johelegp at gmail dot com
@ 2023-10-17  0:47 ` johelegp at gmail dot com
  2023-10-17  3:09 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: johelegp at gmail dot com @ 2023-10-17  0:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Johel Ernesto Guerrero Peña <johelegp at gmail dot com> ---
According to my reading of
<https://eel.is/c++draft/temp.dep> and
<https://eel.is/c++draft/basic.lookup.qual#def:lookup_context>,
Clang and MSVC are right.

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

* [Bug c++/111841] Lookup context rejected at definition if lookup finds a namespace
  2023-10-17  0:40 [Bug c++/111841] New: Lookup context rejected at definition if lookup finds a namespace johelegp at gmail dot com
  2023-10-17  0:47 ` [Bug c++/111841] " johelegp at gmail dot com
@ 2023-10-17  3:09 ` pinskia at gcc dot gnu.org
  2023-10-17  3:12 ` johelegp at gmail dot com
  2023-10-22 18:38 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-17  3:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |98939

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC does not implement
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r6.html (PR
98939) yet.

I am 99% sure that paper is what causes this to be valid.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98939
[Bug 98939] [C++23] Implement P1787R6 "Declarations and where to find them"

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

* [Bug c++/111841] Lookup context rejected at definition if lookup finds a namespace
  2023-10-17  0:40 [Bug c++/111841] New: Lookup context rejected at definition if lookup finds a namespace johelegp at gmail dot com
  2023-10-17  0:47 ` [Bug c++/111841] " johelegp at gmail dot com
  2023-10-17  3:09 ` pinskia at gcc dot gnu.org
@ 2023-10-17  3:12 ` johelegp at gmail dot com
  2023-10-22 18:38 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: johelegp at gmail dot com @ 2023-10-17  3:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Johel Ernesto Guerrero Peña <johelegp at gmail dot com> ---
Thank you.
For reference, here's how I found out this bug:
<https://github.com/hsutter/cppfront/issues/746>.

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

* [Bug c++/111841] Lookup context rejected at definition if lookup finds a namespace
  2023-10-17  0:40 [Bug c++/111841] New: Lookup context rejected at definition if lookup finds a namespace johelegp at gmail dot com
                   ` (2 preceding siblings ...)
  2023-10-17  3:12 ` johelegp at gmail dot com
@ 2023-10-22 18:38 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-22 18:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-10-22
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

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

end of thread, other threads:[~2023-10-22 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-17  0:40 [Bug c++/111841] New: Lookup context rejected at definition if lookup finds a namespace johelegp at gmail dot com
2023-10-17  0:47 ` [Bug c++/111841] " johelegp at gmail dot com
2023-10-17  3:09 ` pinskia at gcc dot gnu.org
2023-10-17  3:12 ` johelegp at gmail dot com
2023-10-22 18:38 ` 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).