This is the mail archive of the gcc-patches@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]

Re: [C++ PATCH] Fix -Wunused-but-set-parameter bug with references (PR c++/47783)


On 02/17/2011 02:54 PM, Jakub Jelinek wrote:
On the following testcase we incorrectly warn that r argument
is set but not used.  For normal references (instead of
references inside of aggregates) we don't warn because we never
consider REFERENCE_TYPE parameters or variables for these warnings.

* cvt.c (convert_from_reference): Call mark_exp_read.

+foo (R r, int&s)
+{
+  r.i = 7;

Are we giving the warning because of this assignment? That's wrong, this assignment does not modify r.


Jason


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