{"push_id":1382400347,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"ecafbe5a312763aa43ff329d2c54db4e40ade1da","before":"7b08e8d3886cb5c9e4254af57ca0c6cc0d508a1f","commits":[{"sha":"ecafbe5a312763aa43ff329d2c54db4e40ade1da","author":{"name":"Eric Fiselier","email":"a16fbdd223a71781803acbd9bd107ba1353fc2f0@efcs.ca"},"message":"[Sema] Allow static_cast<T&&>(e) to check explicit conversions for non-reference-related types.\n\nSummary:\n[expr.cast.static] states:\n> 3. A glvalue of type “cv1 T1” can be cast to type “rvalue reference to cv2 T2” if “cv2 T2” is reference-compatible\n> with “cv1 T1”. The result refers to the object or the specified base class subobject thereof. If T2 is\n> an inaccessible or ambiguous base class of T1, a program that necessitates such a cast is\n> ill-formed.\n> \n> 4. Otherwise, an expression e can be explicitly converted to a type T using a static_cast of the form static_-\n> cast<T>(e) if the declaration T t(e); is well-formed, for some invented temporary variable t. [...]\n\nCurrently when checking p3 Clang will diagnose `static_cast<T&&>(e)` as invalid if the argument is not reference compatible with `T`. However I believe the correct behavior is to also check p4 in those cases.  For example:\n\n```\ndouble y = 42;\nstatic_cast<int&&>(y); // this should be OK.  'int&& t(y)' is well formed\n```\n\nNote that we still don't check p4 for non-reference-compatible types which are reference-related since  `T&& t(e);` should never be well formed in those cases.\n\n\nReviewers: rsmith\n\nSubscribers: cfe-commits\n\nDifferential Revision: https://reviews.llvm.org/D26231\n\ngit-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285872 91177308-0d34-0410-b5e6-96231b3b80d8","distinct":true,"url":"https://api.github.com/repos/llvm-project/clang/commits/ecafbe5a312763aa43ff329d2c54db4e40ade1da"}]}
{"actor":{"display_login":"chapuni"}}