This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/10634] in-class initialization of static data members no longer allowed


------- Additional Comments From pgonzalez at bluel dot com  2004-05-07 11:53 -------
(In reply to comment #6)
> I personally believe we should stick with our present behavior. We have 
> had pretty widely distributed releases 3.2.3 and 3.3.x in between, and 
> have not gotten many reports about this. It seems absurd to go back in 
> 3.4.1 or 3.5.0 to allow behavior that  

I originally solved the problem simply by moving the definition to the
.cpp file.  However, in that case the constant address can no longer be
expanded inline and is replaced with an external reference.  For 
frequently used symbols, this results in extra assembly instructions 
and extra register allocations.  (I encountered the problem with some
highly optimized code for tracing callstacks, i.e. it was called
by __cyg_profile_func_enter() for every single function.)  Also, it
just seems strange to treat "integral" types specially in this context.

If someone thinks these issues might be generally relevant, let me know
and I'll look into the items requested by Giovanni Bajo.  Otherwise, the
patch is here if you want it.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10634


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]