[PATCH] D41977: [libc++] Fix PR20855 -- libc++ incorrectly diagnoses illegal reference binding in std::tuple.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 12 16:21:22 PST 2018


rsmith added a comment.

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.


https://reviews.llvm.org/D41977





More information about the cfe-commits mailing list