Skip to content

Commit 4e0a101

Browse files
author
Erich Keane
authored
[SYCL] Fix StringLiteral Ctor issue from #3504. (#3520)
I'm not sure what causes this to not like this conversion, the error message seems incorrect and only on certain configs of the build, but we should fix the build anyway. This calls the StringRef pointer-size directly, rather than having the StringLiteral type do it.
1 parent 9e2f92e commit 4e0a101

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ class Util {
7373
template <size_t N>
7474
static constexpr DeclContextDesc MakeDeclContextDesc(Decl::Kind K,
7575
const char (&Str)[N]) {
76-
return DeclContextDesc{K, llvm::StringLiteral{Str}};
76+
// FIXME: This SHOULD be able to use the StringLiteral constructor here
77+
// instead, however this seems to fail with an 'invalid string literal' note
78+
// on the correct constructor in some build configurations. We need to
79+
// figure that out before reverting this to use the StringLiteral
80+
// constructor.
81+
return DeclContextDesc{K, StringRef{Str, N - 1}};
7782
}
7883

7984
static constexpr DeclContextDesc MakeDeclContextDesc(Decl::Kind K,

0 commit comments

Comments
 (0)