This is the mail archive of the gcc-bugs@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]

[Bug c++/55993] [C++11] derived-to-base conversion fails in constant expression


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]