[libcxx-dev] Potential bug in use of auto in comparator lambda for std::upper_bound when debug build is enabled

Eric Fiselier via libcxx-dev libcxx-dev at lists.llvm.org
Thu Apr 25 00:22:02 PDT 2019


The code referenced in the diagnostics appears in 7.0 but not 8.0.
At some point the debug implementation was removed from upper and lower
bound,
but I can't find the exact commit that removed it.

Either way this should be fixed now.

/Eric

On Wed, Apr 24, 2019 at 8:41 AM Marshall Clow via libcxx-dev <
libcxx-dev at lists.llvm.org> wrote:

> On Wed, Apr 24, 2019 at 9:15 AM Wesley Yue via libcxx-dev <
> libcxx-dev at lists.llvm.org> wrote:
>
>> I'm working on some code that compares two different types with
>> std::upper_bound and does so with a custom lambda, which takes both
>> parameters as type "auto". When building normally, this compiles fine. When
>> building with -D_LIBCPP_DEBUG=1, this fails and somewhere in the template
>> magic, libc++ seems to confuse the two types and pass them into the lambda
>> backwards.
>>
>> Here is some minimal code to reproduce, and the corresponding compilation
>> error:
>>
>
> I just tried this with libc++ trunk, and didn't get a compile error.
> (I got a link error, but that's because I wasn't linking against a debug
> dylib)
>
> What version of libc++ are you using?
>
> -- Marshall
>
>
> _______________________________________________
> libcxx-dev mailing list
> libcxx-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20190425/80d5b45d/attachment.html>


More information about the libcxx-dev mailing list