On Wed, May 15, 2013 at 5:54 PM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
================<br>
Comment at: lib/Sema/SemaType.cpp:1564-1567<br>
@@ -1555,2 +1563,6 @@<br>
</div><div class="im">           << ArraySize->getSourceRange();<br>
+        // Set array size to largest allowable size.<br>
+        getMaxArraySize(Context, T, ConstantArrayType::getMaxSizeBits(Context),<br>
+                        ConstVal);<br>
+      }<br>
     }<br>
</div>----------------<br>
<div class="im">Richard Smith wrote:<br>
> How about just returning QualType() here? An invalid type should do a better job of suppressing follow-on diagnostics than an array-of-unexpected-size.<br>
</div>Returning QualType() also would prevent the crash, however it also causes a new error to be emitted.  "initializer element is not a compile-time constant" on __builtin_offsetof(struct Chunk2, data).</blockquote>
<div><br></div><div>I think that's basically an unrelated issue: constant expression evaluation doesn't have a way to say "evaluation failed due to an error which has already been diagnosed". I'm OK with that additional diagnostic (with a FIXME to remove it).</div>
</div>