================ @@ -137,9 +136,10 @@ class Interpreter { Expr *SynthesizeExpr(Expr *E); -private: ---------------- weliveindetail wrote:
> We can befriend the test to the interpreter. I don't think we can do this: ``` // Defines FRIEND_TEST. #include <gtest/gtest_prod.h> ``` > make this `protected:` and have a derived class on the test side to access > this The derived class must mimic `clang::Interpreter::create()`, but we can't because the ctor is private. There are a few more options: (1) Allow to derive properly from Interpreter. (Pragmatic choice. Effort seems reasonable.) (2) Build another factory interface around it, like "InterpreterBuilder". (Too much effort.) (3) Integrate it into `IncrementalCompilerBuilder`. (Not sure, but maybe interesting.) (4) Add a special purpose `create` function. (Quick and hacky) This will not remain the only case, where we want to access the extended class surface from tests. What do you think? https://github.com/llvm/llvm-project/pull/84176 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits