re PR c++/68724 (ice in unify, at cp/pt.c:19902)
authorNathan Sidwell <nathan@acm.org>
Fri, 5 Aug 2016 12:21:46 +0000 (12:21 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 5 Aug 2016 12:21:46 +0000 (12:21 +0000)
PR c++/68724
* pt.c (unify): TRAIT_EXPR is an expr.

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

From-SVN: r239167

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

index c295a85bf7046ba31b3756da99c47053c41037a3..ddafa93cae5b1b7ea847c5085abbf8e755a5854b 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-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/72800
index 2f40700538ec03f9b1f99cf9e729ad2bd9601ef9..d3d2d4e4c26b950bbc4a6607edd6c0d23b543f31 100644 (file)
@@ -20269,7 +20269,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);
     expr:
       /* We must be looking at an expression.  This can happen with
         something like:
index 8769e826e017921b22d054a3e71cb5c485aa0d27..e807b298fe3a8057cf607a3f214c88c7424821c8 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-05  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/68724
+       * g++.dg/cpp0x/pr68724.C: New.
+
 2016-08-05  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/ivopt_5.c: Make robust against edge swapping.
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 "" }
+{
+};
+