[llvm-bugs] [Bug 41868] New: Rejects valid on deprecated attributes with a non-narrow string literal
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon May 13 15:51:40 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=41868
Bug ID: 41868
Summary: Rejects valid on deprecated attributes with a
non-narrow string literal
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: aaron at aaronballman.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
The following code is valid in C2x and C++11, but is currently rejected by
Clang:
[[deprecated(L"We can't have nice things")]] int a;
The problem is that Sema::checkStringLiteralArgumentAttr() requires the string
to be ASCII so that it can call StringLiteral::getString() to get a StringRef
to the contents. We could use StringLiteral::outputString() to stream it to a
string buffer, but there are other parts of the APIs that expect a StringRef
and not a std::string, so ClangAttrEmitter would need to be taught about this
for VariadicStringArgument arguments.
I think we might want to encode this as part of the attribute argument
declaration itself. Some attributes may require any form of string literal
(like deprecated does), while others may require ASCII (like section
attributes).
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190513/c5fa4406/attachment.html>
More information about the llvm-bugs
mailing list