This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
In asking this, I'm particularly puzzled by code like this in build_base_path in cp/class.c:
/* 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) { expr = build_nop (build_pointer_type (target_type), expr); if (!want_pointer) expr = build_indirect_ref (EXPR_LOCATION (expr), expr, NULL); return expr; }
Presumably the early return is OK within a sizeof expression; it is OK within an expression like (0 ? x : y)?
struct B {};
struct D : public B {
static const int i = sizeof((B*)(D*)0);
}; struct Z {};
struct A : Z {};
Z* implicitToZ (Z*);
struct B : A {
static const int i = sizeof(implicitToZ((B*)0));
}; struct B {};
struct D;
D* p;
struct D: public B {
static const int i = sizeof ((B*)p);
};| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |