This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37175] Undefined reference to static const member in var = condition ? X::A : X::B
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Aug 2008 09:58:26 -0000
- Subject: [Bug c++/37175] Undefined reference to static const member in var = condition ? X::A : X::B
- References: <bug-37175-16616@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from paolo dot carlini at oracle dot com 2008-08-20 09:58 -------
Yes, because the code is invalid, a *definition* of ABC and DEF is missing: add
const int X::ABC; const int X::DEF; after your declaration of X and things will
work.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37175