[PATCH] D17852: Added formatAndApplyAllReplacements that works on multiple files in libTooling.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 6 12:32:52 PST 2016

ioeric added inline comments.

Comment at: include/clang/Tooling/Core/Replacement.h:230
@@ +229,3 @@
+typedef std::map<const std::string, Replacements>
+    FileToReplacementsMap;
djasper wrote:
> ioeric wrote:
> > djasper wrote:
> > > I think the key type in a map is always const, so no need for "const".
> > I think "const" is needed since the `Entry` passed to map's `[]` operator is of type `const FileEntry *` in `FileToReplaces[Entry].push_back(Replace)`. The code didn't compile without the "const" qualifier.  
> Well, now it's a string and the strings are copied anyway. I am pretty sure it will compile after removing "const".
Ooops! I was on another git branch! Yes, it definitely compiles for `string`. Sorry about that.


More information about the cfe-commits mailing list