<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I see that the following test fails if reverse iteration of
SmallPtrSet is enabled:</p>
<p><i>clang/test/SemaCXX/warn-loop-analysis.cpp</i></p>
<p>This is because in SemaStmt.cpp we iterate SmallPtrSet and output
warnings about the variables not used in the loop.<br>
</p>
<p>Expected output: <i>warning: variables 'i', 'j', and 'k' used in
loop condition not modified</i></p>
<p>Output with reverse iteration: <i>warning: variables 'k', 'j',
and 'i' used in loop condition not</i></p>
<p>I would like the community's opinion on whether this is something
worth fixing? In this case, should the output always be the same
irrespective of the iteration order?<br>
</p>
<p> If yes, then we have 2 alternatives:</p>
<p>1. Change SmallPtrSet to SmallVector for the container (VarDecls)
being iterated - this may have a compile time impact (need to
measure).</p>
<p>2. Sort the container (VarDecls) before iteration. We can sort
based on decl source location and decl name. Not sure if these
guaranteed to be unique?</p>
<p>Thanks,</p>
<p>Mandeep<br>
</p>
</body>
</html>