match: don't modify subexpression list if expression doesn't match the pattern.
As of now the match() method modifies the list of matched subexpressions
(its second argument) even if the expression in question does not match
the pattern. Thus, this simple program
#include <ginac/ginac.h>
#include <iostream>
using namespace GiNaC;
int main(int argc, char** argv)
{
symbol x;
ex e = pow(x, 5);
ex pattern = pow(wild(), -1);
lst repl;
bool test = e.match(pattern, repl);
std::cout << "repl = " << repl << std::endl;
}
prints
repl = {x}
Such behaviour is a bit unexpected. Sometimes it confuses even GiNaC
developers, see e.g.
http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html