[LLVMbugs] Incorrect return types for Statistic operators

Chris Lattner sabre at nondot.org
Wed Oct 30 18:58:10 PST 2002

> The lvalue-returning Statistic<> operators (e.g., ++, =, +=, -=) should
> return a reference to *this, not a reference to the contained Data value.

Good point.  They should return const references, to disallow bizarre
things like:  (A += B) = C;


Thanks again for the patch!



More information about the llvm-bugs mailing list