On Tue, Feb 19, 2013 at 9:58 PM, Matt Arsenault <[email protected]>wrote:
> I was thinking it was the pointee's address space. I've changed that and > added that case to the test > > Hi rsmith, > > http://llvm-reviews.chandlerc.com/D426 > > CHANGE SINCE LAST DIFF > http://llvm-reviews.chandlerc.com/D426?vs=1026&id=1029#toc > > Files: > lib/Sema/SemaOverload.cpp > test/SemaCXX/address-space-initialize.cpp > > Index: lib/Sema/SemaOverload.cpp > =================================================================== > --- lib/Sema/SemaOverload.cpp > +++ lib/Sema/SemaOverload.cpp > @@ -1678,8 +1678,7 @@ > (CanonFrom.getLocalCVRQualifiers() != > CanonTo.getLocalCVRQualifiers() > || CanonFrom.getObjCGCAttr() != CanonTo.getObjCGCAttr() > || CanonFrom.getObjCLifetime() != CanonTo.getObjCLifetime() > - || (CanonFrom->isSamplerT() && > - CanonFrom.getAddressSpace() != CanonTo.getAddressSpace()))) { > + || CanonFrom.getAddressSpace() != CanonTo.getAddressSpace())) { > How about simplifying these four lines to CanonFrom.getLocalQualifiers() != CanonTo.getLocalQualifiers() Other than that, this LGTM. FromType = ToType; > CanonFrom = CanonTo; > } > Index: test/SemaCXX/address-space-initialize.cpp > =================================================================== > --- /dev/null > +++ test/SemaCXX/address-space-initialize.cpp > @@ -0,0 +1,26 @@ > +// RUN: %clang_cc1 -fsyntax-only -verify %s > + > + > +__attribute__((address_space(42))) > +const float withc = 1.0f; > + > +__attribute__((address_space(42))) > +volatile float withv = 1.0f; > + > +__attribute__((address_space(42))) > +float nocv = 1.0f; > + > +__attribute__((address_space(42))) > +float nocv_array[10] = { 1.0f }; > + > +__attribute__((address_space(42))) > +int nocv_iarray[10] = { 4 }; > + > + > +__attribute__((address_space(9999))) > +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]'}} > + > + > +__attribute__((address_space(42))) int* > __attribute__((address_space(42))) ptr_in_same_addr_space = nocv_iarray; > +__attribute__((address_space(42))) int* > __attribute__((address_space(999))) ptr_in_different_addr_space = > nocv_iarray; > + >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
