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++/33515] Inconsistent warning about "defined but not used" when there is an error



------- Comment #5 from bangerth at dealii dot org  2007-09-22 03:57 -------
This code:
----------------
 class Alpha { public: Alpha(); };
  static Alpha* a1 = new Alpha;
----------------
should definitely not draw a warning because during the initialization
of the variable, the constructor of Alpha is run which could have side
effects. Doing stuff like this is actually a fairly frequently used
idiom whereby we can assure that certain resources are already allocated
before we even get to main(). 

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org


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


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