aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-06-04 17:59:22 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-06-04 17:59:22 -0400
commitaa3bf45c241decb77de0d3704ca511c8c186e0d0 (patch)
treeb4873371de4452369cf547609ab447f58bc6d3f3 /gcc
parentc56ba35442a83d6af897bf9a171a126f9ad3f8d9 (diff)
downloadgcc-aa3bf45c241decb77de0d3704ca511c8c186e0d0.zip
gcc-aa3bf45c241decb77de0d3704ca511c8c186e0d0.tar.gz
gcc-aa3bf45c241decb77de0d3704ca511c8c186e0d0.tar.bz2
pt.c (value_dependent_expression_p): Avoid using an uninitialized variable.
* pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid using an uninitialized variable. From-SVN: r160300
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fec4bfd..a67de73 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2010-06-04 Jason Merrill <jason@redhat.com>
+ * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
+ using an uninitialized variable.
+
* cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
(pp_cxx_expression): Likewise.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4c98bf2..d7c0382 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -17596,9 +17596,14 @@ value_dependent_expression_p (tree expression)
return true;
else if (TYPE_P (expression))
return dependent_type_p (expression);
- case NOEXCEPT_EXPR:
return type_dependent_expression_p (expression);
+ case NOEXCEPT_EXPR:
+ expression = TREE_OPERAND (expression, 0);
+ /* FIXME why check value-dependency? */
+ return (type_dependent_expression_p (expression)
+ || value_dependent_expression_p (expression));
+
case SCOPE_REF:
return dependent_scope_ref_p (expression, value_dependent_expression_p);