From: Nathan Sidwell Date: Fri, 5 Aug 2016 12:21:46 +0000 (+0000) Subject: re PR c++/68724 (ice in unify, at cp/pt.c:19902) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4228ca1962a93904e188c8a0d98d10cd0ce7f222;p=gcc.git re PR c++/68724 (ice in unify, at cp/pt.c:19902) PR c++/68724 * pt.c (unify): TRAIT_EXPR is an expr. PR c++/68724 * g++.dg/cpp0x/pr68724.C: New. From-SVN: r239167 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c295a85bf70..ddafa93cae5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-08-05 Nathan Sidwell + + PR c++/68724 + * pt.c (unify): TRAIT_EXPR is an expr. + 2016-08-04 Paolo Carlini PR c++/72800 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2f40700538e..d3d2d4e4c26 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8769e826e01..e807b298fe3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-08-05 Nathan Sidwell + + PR c++/68724 + * g++.dg/cpp0x/pr68724.C: New. + 2016-08-05 Richard Biener * 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 index 00000000000..ff6d84dc3f7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr68724.C @@ -0,0 +1,15 @@ +// PR 68724 ICE in unificiation +// { dg-do compile { target c++11 } } + +template +struct integral_constant +{ +}; + +integral_constant inst; + +template +struct integral_constant // { dg-error "" } +{ +}; +