@@ -169,12 +169,12 @@ class type_erased_cgfo_ty {
169169  //  by a queue. The function object can be a named type, lambda function or
170170  //  std::function.
171171  template  <typename  T> struct  invoker  {
172-     static  void  call (void  *object, handler &cgh) {
173-       (*static_cast <T *>(object))(cgh);
172+     static  void  call (const   void  *object, handler &cgh) {
173+       (*const_cast <T *>( static_cast <const   T *>(object) ))(cgh);
174174    }
175175  };
176-   void  *object;
177-   using  invoker_ty = void  (*)(void  *, handler &);
176+   const   void  *object;
177+   using  invoker_ty = void  (*)(const   void  *, handler &);
178178  const  invoker_ty invoker_f;
179179
180180public: 
@@ -183,15 +183,15 @@ class type_erased_cgfo_ty {
183183      //  NOTE: Even if `T` is a pointer to a function, `&f` is a pointer to a
184184      //  pointer to a function and as such can be casted to `void *` (pointer to
185185      //  a function cannot be casted).
186-       : object(static_cast <void  *>(&f)), invoker_f(&invoker<T>::call) {}
186+       : object(static_cast <const   void  *>(&f)), invoker_f(&invoker<T>::call) {}
187187  ~type_erased_cgfo_ty () = default ;
188188
189189  type_erased_cgfo_ty (const  type_erased_cgfo_ty &) = delete ;
190190  type_erased_cgfo_ty (type_erased_cgfo_ty &&) = delete ;
191191  type_erased_cgfo_ty &operator =(const  type_erased_cgfo_ty &) = delete ;
192192  type_erased_cgfo_ty &operator =(type_erased_cgfo_ty &&) = delete ;
193193
194-   void  operator ()(sycl:: handler &cgh) const  { invoker_f (object, cgh); }
194+   void  operator ()(handler &cgh) const  { invoker_f (object, cgh); }
195195};
196196
197197class  kernel_bundle_impl ;
0 commit comments