[all-commits] [llvm/llvm-project] 95f509: Implement P2361 Unevaluated string literals

cor3ntin via All-commits all-commits at lists.llvm.org
Fri Jul 7 04:30:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95f50964fbf59dc6394898c0719ce8772cc24d25
      https://github.com/llvm/llvm-project/commit/95f50964fbf59dc6394898c0719ce8772cc24d25
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2023-07-07 (Fri, 07 Jul 2023)

  Changed paths:
    M clang-tools-extra/test/clang-tidy/checkers/modernize/unary-static-assert.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/Expr.h
    M clang/include/clang/Basic/DiagnosticLexKinds.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Lex/LiteralSupport.h
    M clang/include/clang/Parse/Parser.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/Expr.cpp
    M clang/lib/Lex/LiteralSupport.cpp
    M clang/lib/Lex/PPMacroExpansion.cpp
    M clang/lib/Lex/Pragma.cpp
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Parse/ParseExpr.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/CXX/dcl.dcl/dcl.link/p2.cpp
    M clang/test/CXX/dcl.dcl/p4-0x.cpp
    M clang/test/FixIt/fixit-static-assert.cpp
    M clang/test/SemaCXX/static-assert.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  Implement P2361 Unevaluated string literals

This patch proposes to handle in an uniform fashion
the parsing of strings that are never evaluated,
in asm statement, static assert, attrributes, extern,
etc.

Unevaluated strings are UTF-8 internally and so currently
behave as narrow strings, but these things will diverge with
D93031.

The big question both for this patch and the P2361 paper
is whether we risk breaking code by disallowing
encoding prefixes in this context.
I hope this patch may allow to gather some data on that.

Future work:
Improve the rendering of unicode characters, line break
and so forth in static-assert messages

Reviewed By: aaron.ballman, shafik

Differential Revision: https://reviews.llvm.org/D105759




More information about the All-commits mailing list