2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-13 15:51:01 +08:00

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
This commit is contained in:
Jason Merrill 2008-01-29 00:50:24 -05:00 committed by Jason Merrill
parent 43fe0f76a7
commit dc5554292f
3 changed files with 28 additions and 1 deletions
gcc
cp
testsuite/g++.dg/inherit

@ -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

@ -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)

@ -0,0 +1,17 @@
// PR c++/35007
struct AffEntry
{
union {
char base[256];
} conds;
};
struct PfxEntry
: public AffEntry
{
PfxEntry()
{
sizeof(conds.base[0]);
}
};