This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12218] [3.4 regression] runtime segfault when initializing global variable with pointer-to-member
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Sep 2003 23:22:02 -0000
- Subject: [Bug c++/12218] [3.4 regression] runtime segfault when initializing global variable with pointer-to-member
- References: <20030908222714.12218.bryner@brianryner.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12218
------- Additional Comments From bangerth at dealii dot org 2003-09-08 23:22 -------
For added confusion -- this code crashes:
-------------------------------
struct C { int i; };
typedef int C::*mPtr;
const mPtr m = &C::i;
int main() {}
-------------------------------
whereas it doesn't if either
a) the variable m is not declared constant, or
b) m is declared in the entirely equivalent way
const int C::*m = &C::i;
W.