@@ -91,6 +91,7 @@ typedef struct A {
91
91
92
92
int fm (void )
93
93
{
94
+ // expected-error@+2 {{SYCL kernel cannot use a non-const static data variable}}
94
95
// expected-error@+1 {{SYCL kernel cannot use a non-const static data variable}}
95
96
return stat_member;
96
97
}
@@ -134,7 +135,7 @@ void usage(myFuncDef functionPtr) {
134
135
// expected-error@+2 {{SYCL kernel cannot call through a function pointer}}
135
136
#endif
136
137
if ((*functionPtr)(1 , 2 ))
137
- // expected-error@+2 {{SYCL kernel cannot use a global variable}}
138
+ // expected-error@+2 {{SYCL kernel cannot use a non-const global variable}}
138
139
// expected-error@+1 {{SYCL kernel cannot call a virtual function}}
139
140
b.f ();
140
141
Check_RTTI_Restriction::kernel1<class kernel_name >([]() {
@@ -163,16 +164,18 @@ int use2 ( a_type ab, a_type *abp ) {
163
164
164
165
if (ab.constexpr_stat_member ) return 2 ;
165
166
if (ab.const_stat_member ) return 1 ;
167
+ // expected-error@+2 {{SYCL kernel cannot use a non-const static data variable}}
166
168
// expected-error@+1 {{SYCL kernel cannot use a non-const static data variable}}
167
169
if (ab.stat_member ) return 0 ;
170
+ // expected-error@+2 {{SYCL kernel cannot use a non-const static data variable}}
168
171
// expected-error@+1 {{SYCL kernel cannot use a non-const static data variable}}
169
172
if (abp->stat_member ) return 0 ;
170
173
if (ab.fm ()) return 0 ;
171
- // expected-error@+1 {{SYCL kernel cannot use a global variable}}
174
+ // expected-error@+1 {{SYCL kernel cannot use a non-const global variable}}
172
175
return another_global ;
173
- // expected-error@+1 {{SYCL kernel cannot use a global variable}}
176
+ // expected-error@+1 {{SYCL kernel cannot use a non-const global variable}}
174
177
return ns::glob +
175
- // expected-error@+1 {{SYCL kernel cannot use a global variable}}
178
+ // expected-error@+1 {{SYCL kernel cannot use a non-const global variable}}
176
179
AnotherNS::moar_globals;
177
180
// expected-note@+1 {{called by 'use2'}}
178
181
eh_not_ok ();
0 commit comments