[PATCH] D138802: [clang][Interp] Implement DecompositionDecls

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 2 09:16:23 PST 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:34-35
 
+  virtual ~DeclScope() override { this->emitDestruction(); }
+
   void addExtended(const Scope::Local &Local) override {
----------------
aaron.ballman wrote:
> The destructor for `LocalScope` already calls `emitDestruction()` which is a virtual function, so is this necessary?
Still wondering about this


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1497
     VariableScope<Emitter> LocalScope(this);
+
     if (VarT) {
----------------
Spurious whitespace change


================
Comment at: clang/test/AST/Interp/cxx17.cpp:30
+  const auto &[a, b] = f;
+
+  return a + b;
----------------
It's be helpful to have a test where `a` and `b` are modified to demonstrate we change the values in `f` as expected. e.g.,
`
F f = getF();
auto &[a, b] = f;
a += 1;
b += 2;

return f.a + f.b;
`


================
Comment at: clang/test/AST/Interp/cxx17.cpp:53-55
+
+
+
----------------
Spurious whitespace


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

https://reviews.llvm.org/D138802



More information about the cfe-commits mailing list