diff --git a/clang/lib/AST/Interp/InterpFrame.h b/clang/lib/AST/Interp/InterpFrame.h index ca9803d48dd15d..88b4a5af8e5a5b 100644 --- a/clang/lib/AST/Interp/InterpFrame.h +++ b/clang/lib/AST/Interp/InterpFrame.h @@ -63,7 +63,7 @@ class InterpFrame final : public Frame { size_t getFrameOffset() const { return FrameOffset; } /// Returns the value of a local variable. - template const T &getLocal(unsigned Offset) { + template const T &getLocal(unsigned Offset) const { return localRef(Offset); } @@ -118,7 +118,7 @@ class InterpFrame final : public Frame { } /// Returns an offset to a local. - template T &localRef(unsigned Offset) { + template T &localRef(unsigned Offset) const { return *reinterpret_cast(Locals.get() + Offset); }