<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Sure, I fixed this in r368610.<div class=""><br class=""></div><div class="">Erik<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 12, 2019, at 11:39 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" class="">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Mon, 12 Aug 2019 at 11:30, Erik Pilkington via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Author: epilk<br class="">Date: Mon Aug 12 11:31:27 2019<br class="">New Revision: 368600<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=368600&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=368600&view=rev</a><br class="">Log:<br class="">[Sema] Require a complete type for __builtin_bit_cast operands<br class=""><br class="">Fixes<span class="Apple-converted-space"> </span><a href="http://llvm.org/PR42936" rel="noreferrer" target="_blank" class="">llvm.org/PR42936</a><br class=""><br class="">Modified:<br class=""> <span class="Apple-converted-space"> </span>cfe/trunk/lib/Sema/SemaCast.cpp<br class=""> <span class="Apple-converted-space"> </span>cfe/trunk/test/SemaCXX/builtin-bit-cast.cpp<br class=""><br class="">Modified: cfe/trunk/lib/Sema/SemaCast.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCast.cpp?rev=368600&r1=368599&r2=368600&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCast.cpp?rev=368600&r1=368599&r2=368600&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/Sema/SemaCast.cpp (original)<br class="">+++ cfe/trunk/lib/Sema/SemaCast.cpp Mon Aug 12 11:31:27 2019<br class="">@@ -2803,6 +2803,14 @@ void CastOperation::CheckBuiltinBitCast(<br class=""> SrcExpr = Self.CreateMaterializeTemporaryExpr(SrcType, SrcExpr.get(),<br class=""> /*IsLValueReference=*/false);<br class=""><br class="">+ if (Self.RequireCompleteType(OpRange.getBegin(), DestType,<br class="">+ diag::err_typecheck_cast_to_incomplete) ||<br class="">+ Self.RequireCompleteType(OpRange.getBegin(), SrcType,<br class="">+ diag::err_incomplete_type)) {<br class=""></blockquote><div class=""><br class=""></div><div class="">Nit: we should check the source type for completeness before performing temporary materialization conversion, as materializing a temporary only makes sense for a complete type.</div><div class=""> <br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">+ SrcExpr = ExprError();<br class="">+ return;<br class="">+ }<br class="">+<br class=""> CharUnits DestSize = Self.Context.getTypeSizeInChars(DestType);<br class=""> CharUnits SourceSize = Self.Context.getTypeSizeInChars(SrcType);<br class=""> if (DestSize != SourceSize) {<br class=""><br class="">Modified: cfe/trunk/test/SemaCXX/builtin-bit-cast.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/builtin-bit-cast.cpp?rev=368600&r1=368599&r2=368600&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/builtin-bit-cast.cpp?rev=368600&r1=368599&r2=368600&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/SemaCXX/builtin-bit-cast.cpp (original)<br class="">+++ cfe/trunk/test/SemaCXX/builtin-bit-cast.cpp Mon Aug 12 11:31:27 2019<br class="">@@ -37,3 +37,12 @@ constexpr unsigned long ul = __builtin_b<br class=""><br class=""> // expected-error@+1 {{__builtin_bit_cast destination type must be trivially copyable}}<br class=""> constexpr long us = __builtin_bit_cast(unsigned long &, 0L);<br class="">+<br class="">+namespace PR42936 {<br class="">+template <class T> struct S { int m; };<br class="">+<br class="">+extern S<int> extern_decl;<br class="">+<br class="">+int x = __builtin_bit_cast(int, extern_decl);<br class="">+S<char> y = __builtin_bit_cast(S<char>, 0);<br class="">+}<br class=""><br class=""><br class="">_______________________________________________<br class="">cfe-commits mailing list<br class=""><a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class=""><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a></blockquote></div></div></div></blockquote></div><br class=""></div></body></html>