<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Dec 7, 2012, at 10:26 , Ted Kremenek <<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Dec 7, 2012, at 9:36 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">//===----------------------------------------------------------------------===//<br>// Fine-grained control of RegionStoreManager.<br>@@ -164,19 +289,15 @@<br>namespace {<br><br>class RegionStoreManager : public StoreManager {<br>+public:<br> const RegionStoreFeatures Features;<br> RegionBindings::Factory RBFactory;<br>- ClusterBindings::Factory CBFactory;<br>+ mutable ClusterBindings::Factory CBFactory;<br></blockquote><br style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">Is there a reason this is mutable? When is the RSM ever const? (Left over from an intermediate attempt?)</span><br style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "></blockquote></div><br><div>Yes.</div><div><br></div><div>Remove it, and you get:</div><div><br></div><div><div>/Volumes/Data/Users/kremenek/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp:478:12: error: no matching constructor for initialization of '<anonymous>::RegionBindingsRef'</div><div> return RegionBindingsRef(CBFactory,</div><div> ^ ~~~~~~~~~~</div><div>/Volumes/Data/Users/kremenek/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp:148:3: note: candidate constructor not viable: 1st argument ('const ClusterBindings::Factory') would lose const qualifier</div><div> RegionBindingsRef(ClusterBindings::Factory &CBFactory,</div><div> ^</div><div>/Volumes/Data/Users/kremenek/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp:154:3: note: candidate constructor not viable: requires 2 arguments, but 3 were provided</div><div> RegionBindingsRef(const ParentTy &P, ClusterBindings::Factory &CBFactory)</div><div> ^</div><div>/Volumes/Data/Users/kremenek/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp:141:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided</div><div>class RegionBindingsRef : public llvm::ImmutableMapRef<const MemRegion *,</div><div> ^</div><div>1 error generated.</div><div>ninja: build stopped: subcommand failed.</div></div><div><br></div><div>The error is in getRegionBindings(), which is marked 'const'. We could also use a const-cast, or remove the 'const' from getRegionBindings() and deal with the fallout.</div></div></blockquote></div><br><div>I don't think getRegionBindings() really is const if it returns something that can modify the set of all regions. I think the Right Thing is to make RegionBindingsRef const-correct, then add a const overload to getRegionBindings to handle includedInBindings (the only externally-visible const function in StoreManager). But we can leave this for now.</div><div><br></div><div>Jordan</div><div><br></div></body></html>