From e021de59f752e4851baed8b5c8b7438f48dc7cf0 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 29 Jan 2008 00:52:20 -0500 Subject: [PATCH] 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: r131933 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/class.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0dd212a6edff..5c8c2a60d176 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2008-01-28 Jason Merrill + + PR c++/35007 + * class.c (build_base_path): Fix !want_pointer case. + 2008-01-27 Jason Merrill PR c++/27177 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 9d7dd8800fd0..6cb040dbea59 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -297,7 +297,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) -- 2.47.2