@@ -265,6 +265,7 @@ class CPPCHECKLIB TemplateSimplifier {
265265 static Token *findTemplateDeclarationEnd (Token *tok);
266266 static const Token *findTemplateDeclarationEnd (const Token *tok);
267267
268+ protected:
268269 /* *
269270 * Match template declaration/instantiation
270271 * @param instance template instantiation
@@ -275,6 +276,7 @@ class CPPCHECKLIB TemplateSimplifier {
275276 */
276277 static bool instantiateMatch (const Token *instance, std::size_t numberOfArguments, bool variadic, const char patternAfter[]);
277278
279+ public: // TODO: only needs to be public for tests
278280 /* *
279281 * Match template declaration/instantiation
280282 * @param tok The ">" token e.g. before "class"
@@ -283,6 +285,7 @@ class CPPCHECKLIB TemplateSimplifier {
283285 */
284286 int getTemplateNamePosition (const Token *tok);
285287
288+ private:
286289 /* *
287290 * Get class template name position
288291 * @param tok The ">" token e.g. before "class"
@@ -307,6 +310,7 @@ class CPPCHECKLIB TemplateSimplifier {
307310 * */
308311 static bool getTemplateNamePositionTemplateVariable (const Token *tok, int &namepos);
309312
313+ public:
310314 /* *
311315 * Simplify templates
312316 * @param maxtime time when the simplification should be stopped
@@ -322,6 +326,7 @@ class CPPCHECKLIB TemplateSimplifier {
322326 */
323327 static bool simplifyNumericCalculations (Token *tok, bool isTemplate = true );
324328
329+ private:
325330 /* *
326331 * Simplify constant calculations such as "1+2" => "3".
327332 * This also performs simple cleanup of parentheses etc.
@@ -336,7 +341,6 @@ class CPPCHECKLIB TemplateSimplifier {
336341 */
337342 void simplifyTemplateArgs (Token *start, const Token *end, std::vector<newInstantiation>* newInst = nullptr );
338343
339- private:
340344 /* *
341345 * Get template declarations
342346 * @return true if code has templates.
0 commit comments