From: bangerth Date: Mon, 30 Jun 2003 19:07:32 +0000 (+0000) Subject: 2003-06-30 Giovanni Bajo X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=5d20b8d6e9c9a04d2d40727e5510c7c93bd77c35;p=pf3gnuchains%2Fgcc-fork.git 2003-06-30 Giovanni Bajo * pt.c (value_dependent_expression_p): Cast expressions are value-dependent also if their operand is value-dependent itself. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68728 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1b56f53df8c..2d80847c549 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11379,7 +11379,8 @@ dependent_type_p (tree type) return TYPE_DEPENDENT_P (type); } -/* Returns TRUE if the EXPRESSION is value-dependent. */ +/* Returns TRUE if the EXPRESSION is value-dependent, in the sense of + [temp.dep.constexpr] */ bool value_dependent_expression_p (tree expression) @@ -11406,13 +11407,15 @@ value_dependent_expression_p (tree expression) && value_dependent_expression_p (DECL_INITIAL (expression))) return true; /* These expressions are value-dependent if the type to which the - cast occurs is dependent. */ + cast occurs is dependent or the expression being casted is + value-dependent. */ if ((TREE_CODE (expression) == DYNAMIC_CAST_EXPR || TREE_CODE (expression) == STATIC_CAST_EXPR || TREE_CODE (expression) == CONST_CAST_EXPR || TREE_CODE (expression) == REINTERPRET_CAST_EXPR || TREE_CODE (expression) == CAST_EXPR) - && dependent_type_p (TREE_TYPE (expression))) + && (dependent_type_p (TREE_TYPE (expression)) + || value_dependent_expression_p (TREE_OPERAND (expression, 0)))) return true; /* A `sizeof' expression where the sizeof operand is a type is value-dependent if the type is dependent. If the type was not