This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55993] [C++11] derived-to-base conversion fails in constant expression
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Jan 2013 19:38:46 +0000
- Subject: [Bug c++/55993] [C++11] derived-to-base conversion fails in constant expression
- Auto-submitted: auto-generated
- References: <bug-55993-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55993
--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> 2013-01-15 19:38:46 UTC ---
(In reply to comment #7)
> e.cc:9:41: error: the value of 'd' is not usable in a constant expression
> constexpr auto g=static_cast<const B&>(d); // FAIL different
> ^
> e.cc:6:13: note: 'd' used in its own initializer
> constexpr D d;
> ^
Those are just because of the missing {} after the declaration of d, the
messages are not optimal, but forget my last comment.
It's just that the error is not exactly in the derived to base conversion but
trying to use that value afterwards.