public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111016] New: Confusing "used in its own initializer" for non-dependent ad-hoc constraint
@ 2023-08-14 16:16 ed at catmur dot uk
  2023-08-14 18:31 ` [Bug c++/111016] " ppalka at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: ed at catmur dot uk @ 2023-08-14 16:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111016
           Summary: Confusing "used in its own initializer" for
                    non-dependent ad-hoc constraint
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ed at catmur dot uk
  Target Milestone: ---

#include <concepts>
struct S { int i; };
static_assert(requires(S s) { requires std::destructible<decltype(s.i)>; });

In file included from <source>:1:
include/c++/14.0.0/concepts:148:13:   required for the satisfaction of
'destructible<decltype (s.i)>'
include/c++/14.0.0/concepts:148:38: error: the value of
'std::__detail::__destructible<decltype (s.i)>' is not usable in a constant
expression
  148 |     concept destructible = __detail::__destructible<_Tp>;
      |                            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
include/c++/14.0.0/concepts:127:22: note:
'std::__detail::__destructible<decltype (s.i)>' used in its own initializer
  127 |       constexpr bool __destructible = __destructible_impl<_Tp>;
      |                      ^~~~~~~~~~~~~~

Obviously this is IFNDR, but it would be nice to emit a diagnostic which gives
some better clue to what is going on (e.g. "warning: constraint is
non-dependent"). Unfortunately both clang and MSVC accept with no diagnostic,
making this look like a gcc bug.

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

* [Bug c++/111016] Confusing "used in its own initializer" for non-dependent ad-hoc constraint
  2023-08-14 16:16 [Bug c++/111016] New: Confusing "used in its own initializer" for non-dependent ad-hoc constraint ed at catmur dot uk
@ 2023-08-14 18:31 ` ppalka at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-08-14 18:31 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
dup of PR110513 I think

*** This bug has been marked as a duplicate of bug 110513 ***

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

end of thread, other threads:[~2023-08-14 18:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-14 16:16 [Bug c++/111016] New: Confusing "used in its own initializer" for non-dependent ad-hoc constraint ed at catmur dot uk
2023-08-14 18:31 ` [Bug c++/111016] " ppalka 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).