Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scan for more template-id alternatives in expression, bug 497931
If parsing expression part for an alternative terminates with BacktrackException, selectFallback() would short-circuit to the longest remaining variant. If that happens to successfully complete parsing till the end of expression token sequence, all of remaining variants are discarded, including the first found alternative which was to parse identifier as template name. This causes expression() to only consider one branchpoint out of all possible variants. Allow it to find more variants by scanning through all branchpoints looking for the alternative with leftmost parsed boundary. This is probably still not ideal but fixes this common std library construct: template <typename T> inline constexpr bool X = true; template <typename T> inline constexpr bool Y = true; template<typename T> bool predicate() { return X<T> && Y<T>; // CDT finds this one: (X) < (T) > (&&Y<T>) // Fix it to also consider (X<T>) && (Y<T>) } Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=497931
- Loading branch information