C++: mitigate matching error on generics containing an expression

Mitigate parse error with generics like `foo<X<Y> x;` by avoiding
matching past a semicolon (";") or open curly brace ("{"), which
can't be part of the generic.  This isn't a proper fix, but mitigates
the impact of such constructs.