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++/52688] static local variable can accessed from local class of function template


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

--- Comment #3 from Sarfaraz Nawaz <sir_nawaz959 at yahoo dot com> 2012-03-24 15:25:22 UTC ---
(In reply to comment #2)
> http://gcc.gnu.org/wiki/VerboseDiagnostics#missing_static_const_definition

Jonathan, that is a different case. A static (const or otherwise) member of a
class needs a definition in order to take its address, but the bug I reported
is not about static member of a class, rather it is about a static variable
local to a function template. Interestingly as I said, this code compiles fine
in gcc-4.5.1, but not in gcc-4.6.1. 


Also, if I do the same in a non-template function, it works fine, as expected.


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