[all-commits] [llvm/llvm-project] 683e83: [Clang][C++2b] P2242R3: Non-literal variables [......

cor3ntin via All-commits all-commits at lists.llvm.org
Tue Mar 22 11:51:34 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 683e83c56f98df6fe42d506a04dda44309ca758f
      https://github.com/llvm/llvm-project/commit/683e83c56f98df6fe42d506a04dda44309ca758f
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticASTKinds.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/Frontend/InitPreprocessor.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp
    A clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3-2b.cpp
    M clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
    M clang/test/Lexer/cxx-features.cpp
    M clang/test/SemaCXX/constant-expression-cxx14.cpp
    A clang/test/SemaCXX/constant-expression-cxx2b.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  [Clang][C++2b] P2242R3: Non-literal variables [...] in constexpr

Allow goto, labelled statements as well as `static`, `thread_local`, and
non-literal variables in `constexpr` functions.

As specified. for all of the above (except labelled statements) constant
evaluation of the construct still fails.

For `constexpr` bodies, the proposal is implemented with diagnostics as
a language extension in older language modes. For determination of
whether a lambda body satisfies the requirements for a constexpr
function, the proposal is implemented only in C++2b mode to retain the
semantics of older modes for programs conforming to them.

Reviewed By: aaron.ballman, hubert.reinterpretcast, erichkeane

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




More information about the All-commits mailing list