public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115280] New: Concept can access private alias in a classs
@ 2024-05-29 16:31 fchelnokov at gmail dot com
  2024-05-29 16:37 ` [Bug c++/115280] Concept can access private alias/typedef in a non-dependent classs pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: fchelnokov at gmail dot com @ 2024-05-29 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115280
           Summary: Concept can access private alias in a classs
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This program
```
#include <concepts>

class A {
    using X = int;
};

template<typename T>
concept C = requires(T t) {
    { t } -> std::convertible_to<A::X>;
};

static_assert(C<int>);
```
is invalid and rejected by Clang with the error:
> error: 'X' is a private member of 'A'

But GCC accepts the program just fine, which looks wrong, online demo:
https://gcc.godbolt.org/z/nra6fExxG

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

* [Bug c++/115280] Concept can access private alias/typedef in a non-dependent classs
  2024-05-29 16:31 [Bug c++/115280] New: Concept can access private alias in a classs fchelnokov at gmail dot com
@ 2024-05-29 16:37 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-29 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
   Last reconfirmed|                            |2024-05-29
            Summary|Concept can access private  |Concept can access private
                   |alias in a classs           |alias/typedef in a
                   |                            |non-dependent classs
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

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

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

end of thread, other threads:[~2024-05-29 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-29 16:31 [Bug c++/115280] New: Concept can access private alias in a classs fchelnokov at gmail dot com
2024-05-29 16:37 ` [Bug c++/115280] Concept can access private alias/typedef in a non-dependent classs 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).