1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00
cdt/core
Igor V. Kovalenko 57a32fc521 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
2023-02-27 13:59:08 -05:00
..
org.eclipse.cdt.core Scan for more template-id alternatives in expression, bug 497931 2023-02-27 13:59:08 -05:00
org.eclipse.cdt.core.linux [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.core.linux.aarch64 [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.core.linux.ppc64le [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.core.linux.x86_64 [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.core.macosx [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.core.native [releng] Update to latest maven-compiler-plugin version 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.core.tests Test for binary expression with variable template args, bug 497931 2023-02-27 13:59:08 -05:00
org.eclipse.cdt.core.win32 [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.core.win32.x86_64 [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00
org.eclipse.cdt.ui Add basic support for c++20 three-way comparison operator 2023-01-28 10:52:07 -05:00
org.eclipse.cdt.ui.tests Mark DocCommentHighlightingTest as flaky 2023-01-30 14:55:55 -05:00
pom.xml [releng] Prepare repo for CDT 11.1.0 development 2022-12-09 12:24:55 -05:00