[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 05:13:24 PDT 2024


================
@@ -324,6 +324,13 @@ class ASTContext : public RefCountedBase<ASTContext> {
   /// This is lazily created.  This is intentionally not serialized.
   mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
 
+  /// The next string literal "version" to allocate during constant evaluation.
+  /// This is used to distinguish between repeated evaluations of the same
+  /// string literal.
+  ///
+  /// TODO: Ensure version numbers don't collide when deserialized.
----------------
AaronBallman wrote:

Should we add a test case involving modules to make sure that behavior is reasonable?

https://github.com/llvm/llvm-project/pull/109208


More information about the cfe-commits mailing list