diff options
| author | Alexey Bader <alexey.bader@intel.com> | 2018-06-20 08:31:24 +0000 |
|---|---|---|
| committer | Alexey Bader <alexey.bader@intel.com> | 2018-06-20 08:31:24 +0000 |
| commit | f29d777f847b2a3d0aec2a499490fa34815fc918 (patch) | |
| tree | ebb1e91f9f98b7b4ef981932abdd2859df09e4ed /clang/test/SemaOpenCL | |
| parent | 16662f3c6ea9bd5cb3459b6ad71d52037f4b397a (diff) | |
| download | bcm5719-llvm-f29d777f847b2a3d0aec2a499490fa34815fc918.tar.gz bcm5719-llvm-f29d777f847b2a3d0aec2a499490fa34815fc918.zip | |
[Sema] Allow creating types with multiple of the same addrspace.
Summary:
The comment with the OpenCL clause about this clearly
says: "No type shall be qualified by qualifiers for
two or more different address spaces."
This must mean that two or more qualifiers for the
_same_ address space is allowed. However, it is
likely unintended by the programmer, so emit a
warning.
For dependent address space types, reject them like
before since we cannot know what the address space
will be.
Patch by Bevin Hansson (ebevhan).
Reviewers: Anastasia
Reviewed By: Anastasia
Subscribers: bader, cfe-commits
Differential Revision: https://reviews.llvm.org/D47630
llvm-svn: 335103
Diffstat (limited to 'clang/test/SemaOpenCL')
| -rw-r--r-- | clang/test/SemaOpenCL/address-spaces.cl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/address-spaces.cl b/clang/test/SemaOpenCL/address-spaces.cl index 2fec3e8647d..c5c58a6a30d 100644 --- a/clang/test/SemaOpenCL/address-spaces.cl +++ b/clang/test/SemaOpenCL/address-spaces.cl @@ -62,4 +62,6 @@ void func_multiple_addr(void) { __private __local int *var2; // expected-error {{multiple address spaces specified for type}} __local private_int_t var3; // expected-error {{multiple address spaces specified for type}} __local private_int_t *var4; // expected-error {{multiple address spaces specified for type}} + __private private_int_t var5; // expected-warning {{multiple identical address spaces specified for type}} + __private private_int_t *var6;// expected-warning {{multiple identical address spaces specified for type}} } |

