[clang] [Driver][SYCL] Error on C inputs when compiling with -fsycl (PR #200318)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 4 06:13:35 PDT 2026
================
@@ -0,0 +1,7 @@
+// Verify that a .c file compiled with -fsycl is an error.
+// RUN: not %clang -### -fsycl %s 2>&1 | FileCheck -check-prefix ERR %s
+// ERR: error: invalid argument '{{.*}}sycl-c-warn.c' not allowed with '-fsycl'
+
+// Verify that explicitly forcing -x c with -fsycl is also an error.
----------------
AaronBallman wrote:
My concern is that SYCL compiler developers will assume it's *not possible* to get C inputs and implement SYCL with those implicit assumptions despite the assumptions being false.
IMO, either C is a valid input language for SYCL and should be supported or it's not a valid input language and we should be able to assert that when `LangOpts.SYCL` is enabled, `LangOpts.CPlusPlus` is as well so we don't force maintainers to think about "what happens with this C-only constructs in SYCL?".
https://github.com/llvm/llvm-project/pull/200318
More information about the cfe-commits
mailing list