[PATCH] D132398: Allow constant static members to be used with 'this'

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 12:29:25 PDT 2022


aaron.ballman added reviewers: aaron.ballman, clang-language-wg.
aaron.ballman added a comment.

Thanks for this! Can you add some more details to the patch description so it's more clear from there why the patch is necessary? Also, can you add a release note for the fix?

I'm pretty sure the changes here are correct, but I want to take another run at the standards wording to be sure.



================
Comment at: clang/lib/AST/ExprConstant.cpp:931
 
+    /// TODO: add doc.
+    bool AccessingStaticConstantDataMember = false;
----------------
Add the docs?


================
Comment at: clang/lib/AST/ExprConstant.cpp:8741-8743
+      if (Info.AccessingStaticConstantDataMember) {
+        return Success(E);
+      }
----------------



================
Comment at: clang/test/SemaCXX/cxx2a-consteval.cpp:925
+}
\ No newline at end of file

----------------
You should add a new line back to the end of the file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132398



More information about the cfe-commits mailing list