diff options
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr68724.C | 15 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c295a85..ddafa93 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2f40700..d3d2d4e 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 8769e82..e807b29 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..ff6d84d --- /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 <typename _Tp, _Tp> +struct integral_constant +{ +}; + +integral_constant<bool, true> inst; + +template <typename _Tp> +struct integral_constant<bool, __is_enum(_Tp)> // { dg-error "" } +{ +}; + |