aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2006-05-14 20:37:56 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2006-05-14 20:37:56 +0000
commitc497db75bae31d76a5402644ef247c2dc48ad801 (patch)
treed2c3f8b2f287aaa758f45c7def17dd6b5475546e /gcc/cp
parentfaf32f4aa5df7a44d5566884150fcf910cc647a5 (diff)
downloadgcc-c497db75bae31d76a5402644ef247c2dc48ad801.zip
gcc-c497db75bae31d76a5402644ef247c2dc48ad801.tar.gz
gcc-c497db75bae31d76a5402644ef247c2dc48ad801.tar.bz2
pt.c (build_non_dependent_expr): Leave ADDR_EXPR of COMPONENT_REF alone.
gcc/cp/ChangeLog: * pt.c (build_non_dependent_expr): Leave ADDR_EXPR of COMPONENT_REF alone. gcc/testsuite/ChangeLog: * g++.dg/template/dependent-expr5.C: New test. From-SVN: r113765
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 898c13f..0af68ec 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * pt.c (build_non_dependent_expr): Leave ADDR_EXPR of
+ COMPONENT_REF alone.
+
2006-05-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27547
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4d34da4..c1530fb 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -12903,10 +12903,11 @@ build_non_dependent_expr (tree expr)
return expr;
/* Preserve OVERLOADs; the functions must be available to resolve
types. */
- inner_expr = (TREE_CODE (expr) == ADDR_EXPR ?
- TREE_OPERAND (expr, 0) :
- TREE_CODE (expr) == COMPONENT_REF ?
- TREE_OPERAND (expr, 1) : expr);
+ inner_expr = expr;
+ if (TREE_CODE (inner_expr) == ADDR_EXPR)
+ inner_expr = TREE_OPERAND (inner_expr, 0);
+ if (TREE_CODE (inner_expr) == COMPONENT_REF)
+ inner_expr = TREE_OPERAND (inner_expr, 1);
if (is_overloaded_fn (inner_expr)
|| TREE_CODE (inner_expr) == OFFSET_REF)
return expr;