This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27177] [4.1/4.2/4.3 Regression] ICE in build_simple_base_path, at cp/class.c:474
- From: "crowl at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2008 21:29:01 -0000
- Subject: [Bug c++/27177] [4.1/4.2/4.3 Regression] ICE in build_simple_base_path, at cp/class.c:474
- References: <bug-27177-12540@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from crowl at google dot com 2008-01-14 21:29 -------
Subject: Re: [4.1/4.2/4.3 Regression] ICE in build_simple_base_path, at
cp/class.c:474
The consensus of the C++ standards reflector is that all three
following code snippets are well-formed.
explicit:
struct B {};
struct D : public B {
static const int i = sizeof((B*)(D*)0);
};
implicit:
struct Z {};
struct A : Z {};
Z* implicitToZ (Z*);
struct B : A {
static const int i = sizeof(implicitToZ((B*)0));
};
non-null:
struct B {};
struct D;
D* p;
struct D: public B {
static const int i = sizeof ((B*)p);
};
The rational is that even though the classes are not complete
within their body, the bases must be known. The reason is that
other features of the language, like co-variant returns, would fail.
Since the bases are known, the conversions are well-formed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27177