isCUDADeviceBuiltinSurfaceType()/isCUDADeviceBuiltinTextureType() do not
work on dependent types as they rely on specific type attributes and that
results in mis-diagnosing access when the check happens on class templates used as texture references.
https://godbolt.org/z/B7rtxR
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Found another corner case (reference within a template with the surface/texture
attibute.) and figured out a better fix.
Added a test case.
Comment Actions
My first variant of the patch only helped with some cases when the surface/texture attribute type was used.
Trying to reduce real-world failure resulted in an example that I've added as the test case which was still failing with this patch applied.
Thanks to @rsmith, who suggested applying MeaningfulToClassTemplateDefinition, the attributes should work for templates now, too.
clang/test/SemaCUDA/device-use-host-var.cu | ||
---|---|---|
169 | use __device__ will make it more readable. same as below. |
use __device__ will make it more readable. same as below.