[llvm-dev] arg_iterator missing inc/dec operators
Reid Kleckner via llvm-dev
llvm-dev at lists.llvm.org
Wed Mar 22 12:56:12 PDT 2017
This code doesn't actually want to create and modify a temporary iterator.
It's better to rewrite this code as std::prev(f->arg_end()).
On Wed, Mar 22, 2017 at 11:58 AM, Dmitry Babokin <babokin at gmail.com> wrote:
> Reid,
>
> After your recent redefinition of arg_iterator, it's missing
> increment/decrement operators (which people typically expect to be defined
> for iterators). So some external code relying on this is broken. If it's
> not intentional, would be nice to have it fixed.
>
> Specific code that I is broken looks like this:
>
> llvm::Function f;
> foo(--f->arg_end()); // passing the last argument to the function.
>
> Dmitry.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170322/053256f4/attachment.html>
More information about the llvm-dev
mailing list