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++/44108] [4.6 Regression] -Wunused-but-set-variable does not consider array sizing use of a const variable



------- Comment #2 from jakub at gcc dot gnu dot org  2010-05-14 07:25 -------
Perhaps we just shouldn't ever warn for TREE_CONSTANT decls with
-Wunused-but-set-* ?
Such variables can't be ever set (the set is just the definition),  
therefore all sets of TREE_USED for them are reads. 
That said, it would be good to find out why we don't warn in that  
case; for [M_CONST + 6] we do warn. 
Or for DECL_INTEGRAL_CONSTANT_VAR_P decls, or for decls for which  
integral_constant_value (decl) != decl not sure what is best.
In any case, compute_array_index_type (and probably many other spots)
calls integral_constant_value and thus
doesn't see the passed in decl anymore afterwards.


-- 


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


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