summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorAlexey Bader <alexey.bader@intel.com>2018-06-20 08:31:24 +0000
committerAlexey Bader <alexey.bader@intel.com>2018-06-20 08:31:24 +0000
commitf29d777f847b2a3d0aec2a499490fa34815fc918 (patch)
treeebb1e91f9f98b7b4ef981932abdd2859df09e4ed /clang/test/Sema
parent16662f3c6ea9bd5cb3459b6ad71d52037f4b397a (diff)
downloadbcm5719-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/Sema')
-rw-r--r--clang/test/Sema/address_spaces.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/test/Sema/address_spaces.c b/clang/test/Sema/address_spaces.c
index 018a8521bfc..87707d7deb0 100644
--- a/clang/test/Sema/address_spaces.c
+++ b/clang/test/Sema/address_spaces.c
@@ -14,6 +14,7 @@ void foo(_AS3 float *a,
int _AS1 _AS2 *Y; // expected-error {{multiple address spaces specified for type}}
int *_AS1 _AS2 *Z; // expected-error {{multiple address spaces specified for type}}
+ int *_AS1 _AS1 *M; // expected-warning {{multiple identical address spaces specified for type}}
_AS1 int local; // expected-error {{automatic variable qualified with an address space}}
_AS1 int array[5]; // expected-error {{automatic variable qualified with an address space}}
OpenPOWER on IntegriCloud