This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20484] No proper linkage created for in class initialized static const
- From: "dopheide at fmf dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2005 18:46:58 -0000
- Subject: [Bug c++/20484] No proper linkage created for in class initialized static const
- References: <20050315154559.20484.dopheide@fmf.nl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dopheide at fmf dot nl 2005-03-15 18:46 -------
You are correct. I was wrong.
I thought, because of consistency reasons, that
1) both should link, or
2) both shouldn't link.
(And I choose 1) for the "bug"-report.)
As I now understand it, the "static int const A = 1;" will be seen as an
"integral constant expression". If, OTOH, a reference has to be taken, it is
seen as a "normal int", thus requiring an actual definition. (It is in 9.4.2 of
the standard.)
See also bugs 14404, 13259, 15244, 17673.
(I search the bugs database before filing, but could not find it.)
It stills /looks/ inconsistent though.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20484