aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2008-01-29 00:50:24 -0500
committerJason Merrill <jason@gcc.gnu.org>2008-01-29 00:50:24 -0500
commitdc5554292fd779dbbb13e37bab33c469704b9ad6 (patch)
tree5203b9723847b896fdb343e8e9486290e0467fb0 /gcc/cp
parent43fe0f76a75564af7cefbce910485b6ea7568bf0 (diff)
downloadgcc-dc5554292fd779dbbb13e37bab33c469704b9ad6.zip
gcc-dc5554292fd779dbbb13e37bab33c469704b9ad6.tar.gz
gcc-dc5554292fd779dbbb13e37bab33c469704b9ad6.tar.bz2
re PR c++/35007 (Firefox fails to build with affentry.cpp:94: error: ISO C++ forbids subscripting non-lvalue array)
PR c++/35007 * class.c (build_base_path): Fix !want_pointer case. From-SVN: r131931
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 118d25d..7b5da53 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-28 Jason Merrill <jason@redhat.com>
+
+ PR c++/35007
+ * class.c (build_base_path): Fix !want_pointer case.
+
2008-01-27 Jason Merrill <jason@redhat.com>
PR c++/27177
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 0ce4ba4..9f7d986 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -296,7 +296,12 @@ build_base_path (enum tree_code code,
/* Don't bother with the calculations inside sizeof; they'll ICE if the
source type is incomplete and the pointer value doesn't matter. */
if (skip_evaluation)
- return build_nop (build_pointer_type (target_type), expr);
+ {
+ expr = build_nop (build_pointer_type (target_type), expr);
+ if (!want_pointer)
+ expr = build_indirect_ref (expr, NULL);
+ return expr;
+ }
/* Do we need to check for a null pointer? */
if (want_pointer && !nonnull)