<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="page" title="Page 690">
<div class="section">
<div class="layoutArea">
<div class="column">
<p><span style="font-size: 10.000000pt; font-family:
'LMRoman10'">+cfe-dev<br>
</span></p>
<p><span style="font-size: 10.000000pt; font-family:
'LMRoman10'">From [meta.unary.prop], for std::is_empty:
"If </span><span style="font-size: 10.000000pt;
font-family: 'LMMono10'">T </span><span
style="font-size: 10.000000pt; font-family: 'LMRoman10'">is
a non-union class
type, </span><span style="font-size: 10.000000pt;
font-family: 'LMMono10'">T </span><span
style="font-size: 10.000000pt; font-family: 'LMRoman10'">shall
be a complete
type.". Since an incomplete array type isn't a class
type, we don't need to require the complete type here,
AFAIK.<br>
</span></p>
<span style="font-size: 10.000000pt; font-family:
'LMRoman10'">Thanks,<br>
Erik<br>
</span><br>
</div>
</div>
</div>
</div>
<div class="moz-cite-prefix">
<p>On 6/6/17 5:18 AM, Puneetha K via llvm-dev wrote:</p>
</div>
<blockquote type="cite"
cite="mid:CAAOtqMnsfcHxnVaMxvphLH0p2r6OV+JJjF7fBT4PGFzmvZVZ3Q@mail.gmail.com">
<div dir="auto">Hi all,
<div dir="auto"><br>
</div>
<div dir="auto">In c++11 and above, llvm supports many type
traits like __is_empty, __is_abstract etc. </div>
<div dir="auto">GCC throws an error if we pass an array of
incomplete type with unknown bounds, saying incomplete type. </div>
<div dir="auto">LLVM also throws an error for some particular
type traits and not for others. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Of what I have read, the standard specifies to
accept only complete type or void for is_empty. </div>
<div dir="auto">But in the code, if we pass an array of unknown
bounds, it still compiles.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Example code: </div>
<div dir="auto"><br>
</div>
<div dir="auto">struct I;</div>
<div dir="auto">int a = __is_empty(I[])</div>
<div dir="auto"><br>
</div>
<div dir="auto">This compiles in the current svn. Whereas isn't
it supposed to give incomplete type error, like GCC? </div>
<div dir="auto"><br>
</div>
<div dir="auto">Thanks & Regards,</div>
<div dir="auto">Puneetha</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>