]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/68724 (ice in unify, at cp/pt.c:19902)
authorNathan Sidwell <nathan@acm.org>
Fri, 5 Aug 2016 19:58:36 +0000 (19:58 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 5 Aug 2016 19:58:36 +0000 (19:58 +0000)
PR c++/68724
* pt.c (unify): TRAIT_EXPR is an expr.

PR c++/68724
* g++.dg/cpp0x/pr68724.C: New.

From-SVN: r239177

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr68724.C [new file with mode: 0644]

index 57aeb7aab27b1ff2f19b8b70dcfa0e8aca9fc91b..86ba3309874382b6c337b7ad7d2baa9543ce3ccd 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-05  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/68724
+       * pt.c (unify): TRAIT_EXPR is an expr.
+
 2016-07-25  Jason Merrill  <jason@redhat.com>
 
        PR c++/71833
index 29badc142c6ca319db3372ffb8abc463a51bc401..578fa20184bdf19a990e620194ba94138f0295d8 100644 (file)
@@ -18807,7 +18807,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
       /* An unresolved overload is a nondeduced context.  */
       if (is_overloaded_fn (parm) || type_unknown_p (parm))
        return unify_success (explain_p);
-      gcc_assert (EXPR_P (parm));
+      gcc_assert (EXPR_P (parm) || TREE_CODE (parm) == TRAIT_EXPR);
 
       /* We must be looking at an expression.  This can happen with
         something like:
index 20670c4377c05cbd217632c9980f6393e88faf4d..d78dded2ad651019ea0db4eaef6594e974d6c55b 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-05  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/68724
+       * g++.dg/cpp0x/pr68724.C: New.
+
 2016-07-29  Paul Thomas  <pault@gcc.gnu.org>
 
        Backport from trunk:
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr68724.C b/gcc/testsuite/g++.dg/cpp0x/pr68724.C
new file mode 100644 (file)
index 0000000..ff6d84d
--- /dev/null
@@ -0,0 +1,15 @@
+// PR 68724 ICE in  unificiation
+// { dg-do compile { target c++11 } }
+
+template <typename _Tp, _Tp>
+struct integral_constant
+{
+};
+
+integral_constant<bool, true> inst;
+
+template <typename _Tp>
+struct integral_constant<bool, __is_enum(_Tp)> // { dg-error "" }
+{
+};
+