[PATCH] D41977: [libc++] Fix PR20855 -- libc++ incorrectly diagnoses illegal reference binding in std::tuple.
Eric Fiselier via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 12 17:56:57 PST 2018
EricWF added a comment.
In https://reviews.llvm.org/D41977#975403, @rsmith wrote:
> This will still diagnose valid and reasonable programs, such as:
>
> struct ConvertToRef { operator int&(); };
> std::tuple<int&> t = {ConvertToRef()};
>
>
> ... on compilers that don't provide the trait. You could maybe try to work around that by checking to see if the type has a member `.operator int&()`. But perhaps it's better to remove the non-conforming check entirely, at least in the case where you can't reasonably get it right.
I agree with both your comments. I'll remove the non-conforming check.
https://reviews.llvm.org/D41977
More information about the cfe-commits
mailing list