[Bug c++/50785] [C++0x] static constexpr double undefined reference

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 19 16:58:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-19 16:58:05 UTC ---
(In reply to comment #11)
> it will be possible to add better waring/error in this case?

Not easily, the error you get is from the linker.  This has been discussed MANY
times in other bugzilla reports, search for PRs with status=RESOLVED and the
words "static const undefined reference"

> maybe some info when you try take ref from const static objects?

No, because there is nothing wrong with doing that as long as you have a
definition for the member.  I do not want the compiler to complain when I write
correct code just to remind people who write incorrect code not to forget
something.



More information about the Gcc-bugs mailing list