Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.
LGTM! Thanks!
https://reviews.llvm.org/D31745
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
echuraev updated this revision to Diff 100210.
https://reviews.llvm.org/D31745
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/SemaOpenCL/clang-builtin-version.cl
test/SemaOpenCL/to_addr_builtin.cl
Index: test/SemaOpenCL/to_addr_builtin.cl
Anastasia added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:12449
// function declaration is going to be treated as an error.
- if (Diags.getDiagnosticLevel(diag_id, Loc) >= DiagnosticsEngine::Error) {
+ if (!getLangOpts().OpenCL &&
+
echuraev added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:12449
// function declaration is going to be treated as an error.
- if (Diags.getDiagnosticLevel(diag_id, Loc) >= DiagnosticsEngine::Error) {
+ if (!getLangOpts().OpenCL &&
+
Anastasia added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:12449
// function declaration is going to be treated as an error.
- if (Diags.getDiagnosticLevel(diag_id, Loc) >= DiagnosticsEngine::Error) {
+ if (!getLangOpts().OpenCL &&
+
echuraev updated this revision to Diff 98958.
echuraev added a comment.
I disabled adding note diagnostic for OpenCL. Addition function to dictionary
occurs in function CurrectTypo. In this function take place creation of
consumer by calling function makeTypoCorrectionConsumer. The function do
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@-1{{did you mean
echuraev 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@-1{{did you mean
echuraev added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8254
"%0 cannot be used as the type of a kernel parameter">;
+def err_opencl_implicit_function_decl : Error<
+ "implicit declaration of function %0 is invalid in OpenCL">;
echuraev updated this revision to Diff 94537.
https://reviews.llvm.org/D31745
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/SemaOpenCL/clang-builtin-version.cl
test/SemaOpenCL/to_addr_builtin.cl
Index: test/SemaOpenCL/to_addr_builtin.cl
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@-1{{did you mean
Anastasia added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8254
"%0 cannot be used as the type of a kernel parameter">;
+def err_opencl_implicit_function_decl : Error<
+ "implicit declaration of function %0 is invalid in OpenCL">;
Anastasia added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8254
"%0 cannot be used as the type of a kernel parameter">;
+def err_opencl_implicit_function_decl : Error<
+ "implicit declaration of function %0 is invalid in OpenCL">;
yaxunl added a comment.
What happens if user declared a function without parameter as `void f();`
instead of `void f(void)` then try to use it? Will this be treated as implicit
declaration and results in an error instead of warning?
https://reviews.llvm.org/D31745
echuraev created this revision.
Herald added a subscriber: yaxunl.
https://reviews.llvm.org/D31745
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/SemaOpenCL/clang-builtin-version.cl
test/SemaOpenCL/to_addr_builtin.cl
Index:
15 matches
Mail list logo