[PATCH] D31745: [OpenCL] Added diagnostic for implicit declaration of function in OpenCL

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 10 11:04:09 PDT 2017


Anastasia added inline comments.


================
Comment at: test/SemaOpenCL/clang-builtin-version.cl:32
+  work_group_reserve_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'work_group_reserve_write_pipe' is invalid in OpenCL}}
+  // expected-note at -1{{did you mean 'work_group_reserve_read_pipe'?}}
+  // expected-note at -2{{'work_group_reserve_write_pipe' declared here}}
----------------
Anastasia wrote:
> echuraev wrote:
> > Anastasia wrote:
> > > Why do we get this note now? I believe work_group_reserve_read_pipe shouldn't be available either?
> > May be I don't understand something but I think that it is the right diagnostic message. We called work_group_reserve_read_pipe in line 29. So for this case we will get the following message: 
> > //clang-builtin-version.cl: 31 error: implicit declaration of function 'work_group_reserve_write_pipe' is invalid in OpenCL
> > clang-builtin-version.cl: 31 note: did you mean 'work_group_reserve_read_pipe'?
> > clang-builtin-version.cl: 29 note: 'work_group_reserve_read_pipe' declared here//
> But there is an error now given for the call to 'work_group_reserve_read_pipe'. Why is it still added to the declarations? I think we should prevent this.
Also do you know why we didn't have these notes before? I don't see anything related in your change.


https://reviews.llvm.org/D31745





More information about the cfe-commits mailing list