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

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 12:38:26 PDT 2022


erichkeane added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:8458
+          Info.AccessingStaticConstantDataMember);
+      if(Info.InConstantContext)
+        Info.AccessingStaticConstantDataMember = true;
----------------
When not in a constant-context, what should we be doing here? Why doesn't that set the variable?


================
Comment at: clang/lib/AST/ExprConstant.cpp:8460
+        Info.AccessingStaticConstantDataMember = true;
       VisitIgnoredBaseExpression(E->getBase());
       return Success(MD);
----------------
Will this visit end up looking into OTHER things here?  I guess I'm concerned about something like:

`this->get_some_other_type().static_func()` and us skipping the `this->` for THAT, despite it not being a static call in that context.


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