public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ville Voutilainen <ville.voutilainen@gmail.com>
To: gcc-patches@gcc.gnu.org, "libstdc++" <libstdc++@gcc.gnu.org>
Subject: [v3 PATCH] PR libstdc++/68430
Date: Sat, 16 Dec 2017 12:30:00 -0000	[thread overview]
Message-ID: <CAFk2RUa8jX4ToMNiRu4aYHLnNscGAci8BH2O8EJqh9AvnvSZrw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

The compiler-powered is_constructible that we have in gcc 8 is powerful
enough to give the right answer to an is_constructible question
that would be hard for a pure-library implementation to get right
in a well-formed fashion. This is just adding a test for it. Tested
on Linux-PPC64, OK for trunk?

2017-12-16  Ville Voutilainen  <ville.voutilainen@gmail.com>

    PR libstdc++/68430
    * testsuite/20_util/is_constructible/68430.cc: New.

[-- Attachment #2: 68430.diff --]
[-- Type: text/plain, Size: 449 bytes --]

diff --git a/libstdc++-v3/testsuite/20_util/is_constructible/68430.cc b/libstdc++-v3/testsuite/20_util/is_constructible/68430.cc
new file mode 100644
index 0000000..3f880b3
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_constructible/68430.cc
@@ -0,0 +1,6 @@
+// { dg-do compile { target c++11 } }
+
+#include <type_traits>
+
+template<class T> struct Foo { Foo(T = nullptr) {} };
+static_assert(!std::is_constructible<Foo<int>>::value, "");

             reply	other threads:[~2017-12-16 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-16 12:30 Ville Voutilainen [this message]
2017-12-18 17:58 ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFk2RUa8jX4ToMNiRu4aYHLnNscGAci8BH2O8EJqh9AvnvSZrw@mail.gmail.com \
    --to=ville.voutilainen@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).