[PATCH] D154290: [Clang] Implement P2741R3 - user-generated static_assert messages

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 8 04:22:13 PDT 2023


cor3ntin added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16898
+  }
+
+  QualType T = Message->getType().getNonReferenceType();
----------------
tbaeder wrote:
> What if the message is ` StringLiteral` but `getCharByteWidth()` doesn't return `1`? We would get the `err_static_assert_invalid_message` because` !RD` is true, right?
I forgot to change that while merging. StringLiteral are guaranteed to be unevaluated there


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16900
+  QualType T = Message->getType().getNonReferenceType();
+  auto *RD = T->getAsCXXRecordDecl();
+  if (!RD) {
----------------
tbaeder wrote:
> 
Alas, `LookupQualifiedName` takes a non-const argument


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154290/new/

https://reviews.llvm.org/D154290



More information about the cfe-commits mailing list