[clang] [SYCL] Error on C inputs when compiling with -fsycl (PR #200318)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 8 05:42:50 PDT 2026
================
@@ -635,6 +635,11 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
Diags.Report(diag::err_drv_argument_not_allowed_with) << "-fsycl-is-device"
<< "-fsycl-is-host";
+ // SYCL requires C++; reject C inputs on both device and host.
+ if ((LangOpts.SYCLIsDevice || LangOpts.SYCLIsHost) && !LangOpts.CPlusPlus)
+ Diags.Report(diag::err_drv_argument_not_allowed_with)
----------------
AaronBallman wrote:
This is following the same pattern as surrounding code, but I do wonder if these diagnostics are declared in the correct diagnostics file. e.g. this is in DiagnosticDriverKinds.td but we've got DiagnosticFrontendKinds.td.
Nothing to fix for this PR because this is following existing patterns.
https://github.com/llvm/llvm-project/pull/200318
More information about the cfe-commits
mailing list