<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Index: lib/Sema/SemaStmt.cpp<br>
===================================================================<br>
--- lib/Sema/SemaStmt.cpp (revision 129825)<br>
+++ lib/Sema/SemaStmt.cpp (working copy)<br>
@@ -1257,7 +1257,8 @@<br>
ExprResult BoundExpr;<br>
if (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(UnqAT))<br>
BoundExpr = Owned(IntegerLiteral::Create(Context, CAT->getSize(),<br>
- Context.IntTy, RangeLoc));<br>
+<br>
Context.getPointerDiffType(),<br>
+ RangeLoc));<br>
<br>
<br>
This should be the pointer difference type for the right address space.<br>
You could add an accessor to ASTContext to get the corresponding type for<br>
the array's address space from the target info (perhaps<br>
ASTContext::getArrayBoundType(QualType ArrayType)).<br></blockquote><div><br></div><div>I am not sure I understand. I thought that there's only one pointer difference type? </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
else if (const VariableArrayType *VAT =<br>
dyn_cast<VariableArrayType>(UnqAT))<br>
BoundExpr = VAT->getSizeExpr();<br>
<br>
<br>
Thanks again for looking into this!<br>
<font color="#888888">Richard<br>
<br>
</font></blockquote></div><br>