@@ -49,12 +49,21 @@ class TestPreprocessor : public TestFixture {
4949 TestPreprocessor () : TestFixture(" TestPreprocessor" ) {}
5050
5151private:
52+ class PreprocessorTest : public Preprocessor
53+ {
54+ friend class TestPreprocessor ;
55+ public:
56+ PreprocessorTest (simplecpp::TokenList& tokens, const Settings& settings, ErrorLogger &errorLogger, Standards::Language lang)
57+ : Preprocessor(tokens, settings, errorLogger, lang)
58+ {}
59+ };
60+
5261 template <size_t size>
5362 std::string expandMacros (const char (&code)[size], ErrorLogger &errorLogger) const {
5463 simplecpp::OutputList outputList;
5564 std::vector<std::string> files;
5665 simplecpp::TokenList tokens1 = simplecpp::TokenList (code, files, " file.cpp" , &outputList);
57- Preprocessor p (tokens1, settingsDefault, errorLogger, Path::identify (tokens1.getFiles ()[0 ], false ));
66+ PreprocessorTest p (tokens1, settingsDefault, errorLogger, Path::identify (tokens1.getFiles ()[0 ], false ));
5867 simplecpp::TokenList tokens2 = p.preprocess (" " , files, true );
5968 p.reportOutput (outputList, true );
6069 return tokens2.stringify ();
@@ -119,15 +128,15 @@ class TestPreprocessor : public TestFixture {
119128
120129 simplecpp::TokenList tokens (code, size, files, Path::simplifyPath (filename), &outputList);
121130 // TODO: we should be using the actual Preprocessor implementation
122- Preprocessor preprocessor (tokens, settings, errorlogger, Path::identify (tokens.getFiles ()[0 ], false ));
131+ PreprocessorTest preprocessor (tokens, settings, errorlogger, Path::identify (tokens.getFiles ()[0 ], false ));
123132 if (inlineSuppression)
124133 preprocessor.inlineSuppressions (*inlineSuppression);
125134 preprocessor.removeComments ();
126135 preprocessor.simplifyPragmaAsm ();
127136
128137 preprocessor.reportOutput (outputList, true );
129138
130- if (Preprocessor ::hasErrors (outputList))
139+ if (PreprocessorTest ::hasErrors (outputList))
131140 return {};
132141
133142 std::map<std::string, std::string> cfgcode;
0 commit comments