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

2011-10-19 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|

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

2011-10-19 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785 --- Comment #6 from Paolo Carlini 2011-10-19 12:47:47 UTC --- I agree, I agree.

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

2011-10-19 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785 --- Comment #5 from Jonathan Wakely 2011-10-19 12:46:00 UTC --- and I assume -O eliminates the reference binding due to inlining and value propagation this all seems normal for a missing definition of a static const member, like dozens of other

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

2011-10-19 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785 --- Comment #4 from Jonathan Wakely 2011-10-19 12:43:59 UTC --- test::value is an lvalue, binding a reference to it is an odr-use (1*test::value) produces an rvalue, the reference is not bound to test::value, so it is not odr-used

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

2011-10-19 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785 Paolo Carlini changed: What|Removed |Added CC||jason at gcc dot gnu.org --- Comment #3 f

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

2011-10-19 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785 --- Comment #2 from Jonathan Wakely 2011-10-19 08:34:45 UTC --- The definition is required, see [class.static.data] p3 "A static data member of literal type can be declared in the class definition with the constexpr specifier; [...] The member sha

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

2011-10-18 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785 --- Comment #1 from Paolo Carlini 2011-10-19 01:34:50 UTC --- What happens if you add a definition: constexpr double test::value; after your struct like you would for any non-constrexpr static data member?