public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108588] New: __is_constructible returns wrong value for invalid (but non deleted) default constructor
@ 2023-01-29  8:38 roi.jacobson1 at gmail dot com
  2023-02-08  9:23 ` [Bug c++/108588] " fchelnokov at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: roi.jacobson1 at gmail dot com @ 2023-01-29  8:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108588
           Summary: __is_constructible returns wrong value for invalid
                    (but non deleted) default constructor
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roi.jacobson1 at gmail dot com
  Target Milestone: ---

A weird edge case around is_constructible was reported to Clang at
https://github.com/llvm/llvm-project/issues/60293, and we think GCC might have
a bug around invalid and defaulted default constructors:

template <class T>
struct Wrapper {
    T x = (void*)nullptr;
};

static_assert(!__is_constructible(Wrapper<int>));

This code currently compiles under GCC. But by [class.default.ctor#2.7],
Wrapper's default constructor is not deleted and so __is_constructible has no
business returning false - it should either return true or diagnose an error
while instantiating the default constructor that would not be in the immediate
context.

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

* [Bug c++/108588] __is_constructible returns wrong value for invalid (but non deleted) default constructor
  2023-01-29  8:38 [Bug c++/108588] New: __is_constructible returns wrong value for invalid (but non deleted) default constructor roi.jacobson1 at gmail dot com
@ 2023-02-08  9:23 ` fchelnokov at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: fchelnokov at gmail dot com @ 2023-02-08  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
According to this StackOverflow answer, the behavior of GCC is incorrect here:
https://stackoverflow.com/a/75380301/7325599

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

end of thread, other threads:[~2023-02-08  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29  8:38 [Bug c++/108588] New: __is_constructible returns wrong value for invalid (but non deleted) default constructor roi.jacobson1 at gmail dot com
2023-02-08  9:23 ` [Bug c++/108588] " fchelnokov at gmail dot com

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