<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Rejects valid on deprecated attributes with a non-narrow string literal"
   href="https://bugs.llvm.org/show_bug.cgi?id=41868">41868</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Rejects valid on deprecated attributes with a non-narrow string literal
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>aaron@aaronballman.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>