[PATCH] D111400: [Clang][C++2b] P2242R3: Non-literal variables [...] in constexpr
Hubert Tong via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 19 22:31:42 PDT 2022
hubert.reinterpretcast added inline comments.
================
Comment at: clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp:26
};
- struct Nonlit { Nonlit(); }; // expected-note {{not literal}}
+ struct Nonlit { // cxx2a-note {{'Nonlit' is not literal becaus}}
+ Nonlit();
----------------
s/becaus/because/;
================
Comment at: clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3-2b.cpp:36-39
+constexpr void non_literal2(bool b) {
+ if (!b)
+ NonLiteral n;
+}
----------------
There should be a version of this in `constant-expression-cxx2b.cpp` where the function is called successfully during constant expression evaluation.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111400/new/
https://reviews.llvm.org/D111400
More information about the cfe-commits
mailing list