This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31226] New: static const volatile variables don't get linked correctly
- From: "zickzack at w84u dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Mar 2007 17:59:44 -0000
- Subject: [Bug c++/31226] New: static const volatile variables don't get linked correctly
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program does not link:
#include <iostream>
class A {
public:
static bool const volatile doit = true;
};
using namespace std;
int main()
{
if( A::doit ) cout << "doit is <true>";
else cout << "doit is <false>";
}
The link error is:
$ g++ -o mytest mytest.cc
/tmp/ccdPkdpO.o: In function `main':
/tmp/ccdPkdpO.o(.text+0x11): undefined reference to `A::doit'
collect2: ld returned 1 exit status
If volatile is removed, everything works.
--
Summary: static const volatile variables don't get linked
correctly
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: zickzack at w84u dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31226