On Tue, Feb 19, 2013 at 9:58 PM, Matt Arsenault <span dir="ltr"><<a href="mailto:Matthew.Arsenault@amd.com" target="_blank">Matthew.Arsenault@amd.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">
  I was thinking it was the pointee's address space. I've changed that and added that case to the test<br>
<br>
Hi rsmith,<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D426" target="_blank">http://llvm-reviews.chandlerc.com/D426</a><br>
<br>
CHANGE SINCE LAST DIFF<br>
  <a href="http://llvm-reviews.chandlerc.com/D426?vs=1026&id=1029#toc" target="_blank">http://llvm-reviews.chandlerc.com/D426?vs=1026&id=1029#toc</a><br>
<div class="im"><br>
Files:<br>
  lib/Sema/SemaOverload.cpp<br>
  test/SemaCXX/address-space-initialize.cpp<br>
<br>
Index: lib/Sema/SemaOverload.cpp<br>
===================================================================<br>
--- lib/Sema/SemaOverload.cpp<br>
+++ lib/Sema/SemaOverload.cpp<br>
</div>@@ -1678,8 +1678,7 @@<br>
<div class="im">         (CanonFrom.getLocalCVRQualifiers() != CanonTo.getLocalCVRQualifiers()<br>
          || CanonFrom.getObjCGCAttr() != CanonTo.getObjCGCAttr()<br>
          || CanonFrom.getObjCLifetime() != CanonTo.getObjCLifetime()<br>
-         || (CanonFrom->isSamplerT() &&<br>
</div>-           CanonFrom.getAddressSpace() != CanonTo.getAddressSpace()))) {<br>
+         || CanonFrom.getAddressSpace() != CanonTo.getAddressSpace())) {<br></blockquote><div><br></div><div>How about simplifying these four lines to</div><div><br></div><div>  CanonFrom.getLocalQualifiers() != CanonTo.getLocalQualifiers()</div>
<div> </div><div>Other than that, this LGTM.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">       FromType = ToType;<br>
       CanonFrom = CanonTo;<br>
     }<br>
Index: test/SemaCXX/address-space-initialize.cpp<br>
===================================================================<br>
--- /dev/null<br>
+++ test/SemaCXX/address-space-initialize.cpp<br>
</div>@@ -0,0 +1,26 @@<br>
<div class="im">+// RUN: %clang_cc1 -fsyntax-only -verify %s<br>
+<br>
+<br>
+__attribute__((address_space(42)))<br>
+const float withc = 1.0f;<br>
+<br>
+__attribute__((address_space(42)))<br>
+volatile float withv = 1.0f;<br>
+<br>
+__attribute__((address_space(42)))<br>
+float nocv = 1.0f;<br>
+<br>
+__attribute__((address_space(42)))<br>
+float nocv_array[10] = { 1.0f };<br>
+<br>
+__attribute__((address_space(42)))<br>
+int nocv_iarray[10] = { 4 };<br>
+<br>
+<br>
+__attribute__((address_space(9999)))<br>
+int* as_ptr = nocv_iarray; // expected-error{{cannot initialize a variable of type '__attribute__((address_space(9999))) int *' with an lvalue of type '__attribute__((address_space(42))) int [10]'}}<br>
+<br>
+<br>
</div>+__attribute__((address_space(42))) int* __attribute__((address_space(42))) ptr_in_same_addr_space = nocv_iarray;<br>
+__attribute__((address_space(42))) int* __attribute__((address_space(999))) ptr_in_different_addr_space = nocv_iarray;<br>
+<br>
</blockquote></div><br>