diff --git a/clang/lib/Sema/SemaSYCL.cpp b/clang/lib/Sema/SemaSYCL.cpp index c7be03e5f813f..bcc49c2232967 100644 --- a/clang/lib/Sema/SemaSYCL.cpp +++ b/clang/lib/Sema/SemaSYCL.cpp @@ -73,7 +73,12 @@ class Util { template static constexpr DeclContextDesc MakeDeclContextDesc(Decl::Kind K, const char (&Str)[N]) { - return DeclContextDesc{K, llvm::StringLiteral{Str}}; + // FIXME: This SHOULD be able to use the StringLiteral constructor here + // instead, however this seems to fail with an 'invalid string literal' note + // on the correct constructor in some build configurations. We need to + // figure that out before reverting this to use the StringLiteral + // constructor. + return DeclContextDesc{K, StringRef{Str, N - 1}}; } static constexpr DeclContextDesc MakeDeclContextDesc(Decl::Kind K,