public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38624] New: static const data members can't be passed to const reference
@ 2008-12-25 0:24 m_albert137 at yahoo dot com
2008-12-25 1:07 ` [Bug c++/38624] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: m_albert137 at yahoo dot com @ 2008-12-25 0:24 UTC (permalink / raw)
To: gcc-bugs
For the following code, one has the following:
g++ main.cpp : undefined reference to `X::VAL1'
g++ main.cpp -O3 : links O.K.
----------------------main.cpp------------------------------
struct X { static const int VAL1 = 17; };
int func1( const int aVal ) { }
int func2( const int &aVal ) { }
int main()
{
func1( ::X::VAL1 );
func2( ::X::VAL1 ); //undefined reference to ::X::VAL1 ??
}
--
Summary: static const data members can't be passed to const
reference
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: m_albert137 at yahoo dot com
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38624
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/38624] static const data members can't be passed to const reference
2008-12-25 0:24 [Bug c++/38624] New: static const data members can't be passed to const reference m_albert137 at yahoo dot com
@ 2008-12-25 1:07 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-25 1:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-25 01:05 -------
You still need a definition of X::VAL1, you only have a declaration of it.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38624
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-25 1:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-25 0:24 [Bug c++/38624] New: static const data members can't be passed to const reference m_albert137 at yahoo dot com
2008-12-25 1:07 ` [Bug c++/38624] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).