This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50785] [C++0x] static constexpr double undefined reference
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Oct 2011 16:58:05 +0000
- Subject: [Bug c++/50785] [C++0x] static constexpr double undefined reference
- Auto-submitted: auto-generated
- References: <bug-50785-4@http.gcc.gnu.org/bugzilla/>
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.