public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ PATCH for c++/81589, error with is_trivially_constructible
@ 2018-02-26  6:20 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2018-02-26  6:20 UTC (permalink / raw)
  To: gcc-patches List; +Cc: Ville Voutilainen

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

Applying this one line from Ville's patch for 80654 fixes the Chromium testcase.

Tested x86_64-pc-linux-gnu, applying to 7 branch.

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

commit 57b9683f0ce55a410c567fcb2dc365a2cc848d6a
Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Feb 26 06:09:07 2018 +0000

            PR c++/81589 - error with is_trivially_constructible.
    
            * method.c (constructible_expr): Set cp_unevaluated.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257981 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 59ad43f73fe..a2d4c071efa 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1165,6 +1165,7 @@ constructible_expr (tree to, tree from)
     {
       tree ctype = to;
       vec<tree, va_gc> *args = NULL;
+      cp_unevaluated cp_uneval_guard;
       if (TREE_CODE (to) != REFERENCE_TYPE)
 	to = cp_build_reference_type (to, /*rval*/false);
       tree ob = build_stub_object (to);
diff --git a/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C b/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C
new file mode 100644
index 00000000000..10a8dfbb8f0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C
@@ -0,0 +1,10 @@
+// PR c++/81589
+
+template <typename k>
+struct z {
+  z() {
+    k::error;
+  }
+};
+
+int x = __is_trivially_constructible(z<int>);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-26  6:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26  6:20 C++ PATCH for c++/81589, error with is_trivially_constructible Jason Merrill

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