djasper added a comment.

The problem is that it is implicit behavior, that's not easy to understand. 
What's worse is that the behavior of add and merge would fundamentally be 
reverse. If you add two inserts at the same location, the first one would come 
first. If you merge them, the second one would come first.

And you parentheses example is actually a good one. The tool you would write 
for that would insert the parentheses pair-wise, e.g. in an ASTMatchFinder 
callback. Without extra effort, the opening parentheses and the closing 
parentheses would be inserted in the same order, which is wrong. Doesn't matter 
as they are identical, but assume you'd want to add () and [].. You'd likely 
end up with "([...)]".

We should definitely provide ways to support such use cases, but I think the 
default behavior should for now be to report an error.


https://reviews.llvm.org/D24383



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to