@@ -4082,6 +4082,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4082
4082
CmdArgs.push_back (Args.MakeArgString (NormalizedTriple));
4083
4083
}
4084
4084
4085
+ Arg *SYCLStdArg = Args.getLastArg (options::OPT_sycl_std_EQ);
4086
+
4085
4087
if (UseSYCLTriple) {
4086
4088
// We want to compile sycl kernels.
4087
4089
CmdArgs.push_back (" -fsycl" );
@@ -4117,9 +4119,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4117
4119
options::OPT_fno_sycl_allow_func_ptr, false )) {
4118
4120
CmdArgs.push_back (" -fsycl-allow-func-ptr" );
4119
4121
}
4120
- }
4121
4122
4122
- Arg *SYCLStdArg = Args.getLastArg (options::OPT_sycl_std_EQ);
4123
+ if (!SYCLStdArg) {
4124
+ // The user had not pass SYCL version, thus we'll employ no-sycl-strict
4125
+ // to allow address-space unqualified pointers in function params/return
4126
+ // along with marking the same function with explicit SYCL_EXTERNAL
4127
+ CmdArgs.push_back (" -Wno-sycl-strict" );
4128
+ }
4129
+ }
4123
4130
4124
4131
if (IsSYCL) {
4125
4132
if (SYCLStdArg) {
@@ -4131,13 +4138,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4131
4138
}
4132
4139
}
4133
4140
4134
- if (UseSYCLTriple && !SYCLStdArg) {
4135
- // The user had not pass SYCL version, thus we'll employ no-sycl-strict
4136
- // to allow address-space unqualified pointers in function params/return
4137
- // along with marking the same function with explicit SYCL_EXTERNAL
4138
- CmdArgs.push_back (" -Wno-sycl-strict" );
4139
- }
4140
-
4141
4141
if (IsOpenMPDevice) {
4142
4142
// We have to pass the triple of the host if compiling for an OpenMP device.
4143
4143
std::string NormalizedTriple =
0 commit comments