diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 17 |
2 files changed, 21 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8228c8f0..e24a194 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-10-24 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/80991 + * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle + a TREE_LIST as TRAIT_EXPR_TYPE2. + 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com> Paolo Carlini <paolo.carlini@oracle.com> diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ba52f3b..be39da7 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -24019,8 +24019,21 @@ value_dependent_expression_p (tree expression) case TRAIT_EXPR: { tree type2 = TRAIT_EXPR_TYPE2 (expression); - return (dependent_type_p (TRAIT_EXPR_TYPE1 (expression)) - || (type2 ? dependent_type_p (type2) : false)); + + if (dependent_type_p (TRAIT_EXPR_TYPE1 (expression))) + return true; + + if (!type2) + return false; + + if (TREE_CODE (type2) != TREE_LIST) + return dependent_type_p (type2); + + for (; type2; type2 = TREE_CHAIN (type2)) + if (dependent_type_p (TREE_VALUE (type2))) + return true; + + return false; } case MODOP_EXPR: |