This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15839] Requires definition of literal passed as const reference
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jun 2004 04:44:59 -0000
- Subject: [Bug c++/15839] Requires definition of literal passed as const reference
- References: <20040606043337.15839.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-06 04:44 -------
Invalid here is a reduced source:
struct t
{
static const int t1 = 1;
};
int g(const int&){}
int main()
{
g(t::t1);
}
The problem is that you do not define the static int any where(outside the class). Read bug 13259 for
more information as this is a dup of that bug.
Hint for the above testcase adding the following will work:
const int t::t1;
*** This bug has been marked as a duplicate of 13259 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15839