1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00
Commit graph

14354 commits

Author SHA1 Message Date
John Dallaway
0d9fa844bf Set tool prefix for spawning GNU tool processes
Allows the GNU tool prefix to be specified by a CDT build variable.

Modifies the Cross GCC toolchain description to provide the GNU tool
prefix.

Part of #361
2023-04-17 20:24:56 +01:00
John Dallaway
fe65ab6287 Set environment for spawning GNU tool processes
Allows GNU tools to be found on the PATH defined by the build
configuration of the containing project.

Part of #361
2023-04-16 09:09:47 +01:00
John Dallaway
45a6e7957b Add GNU PE64 binary parser for MinGW GCC toolchain
Part of #361
2023-04-13 21:54:36 +01:00
Dillon Shaffer
eb237ebcba Allow symmetrical patterns for replace keys
Update getReplaceKeys to allow for patterns with matching start and end delimiters. Previously, `%%key%%` would throw and OutOfBoundsException instead of matching the key inside the delimiters.
2023-04-10 18:33:40 -04:00
Igor V. Kovalenko
ad15e0e804 Add c++20 character types 2023-04-10 18:33:16 -04:00
Gesa HENTSCHKE
d2a5a57d01 Support IEditorAssociationOverride (#341) 2023-04-04 14:36:04 -04:00
Igor V. Kovalenko
6cf3e03c35 Allow disambiguating class constructor definition followed by semicolon
In this case member variable declaration would be longer (including
trailing semicolon) but it is not valid since a class C shall not contain
a non-static member of class C.
2023-04-04 14:34:54 -04:00
Igor V. Kovalenko
f768aed976 Add __builtin_is_constant_evaluated 2023-04-04 14:15:56 -04:00
Igor V. Kovalenko
3fdea6e31a Allow binary operator templates 2023-04-04 14:12:24 -04:00
Igor V. Kovalenko
385b915257 Do not error out failing to resolve function in dependend context
Detect if function set failed to resolve while instantiating for template-id
which still has dependend arguments. Since resolution still can succeed later
via ADL when template-id is fully instantiated, do not error out immediately
and return original evaluation to allow trying to instantiate later.
2023-04-04 14:10:40 -04:00
Jonah Graham
47275c3884 Remove reference to Navigator view that has been removed
The long deprecated for removal navigator view has been removed
from upcoming Eclipse Platform.

I don't know if there are other locations in CDT that are affected,
but this change covers the compilation failure of the removal.

xref: https://github.com/eclipse-platform/eclipse.platform.ui/issues/644
2023-04-02 17:17:37 -04:00
Jonah Graham
0dabaa15fb Handle null "DisplayName" in registry
Fixes #330
2023-03-20 09:21:57 -04:00
Erwin Waterlander
2b297c4355 Issue #167 - Core Build Makefile project build output folder.
* Issue Issue #167 was partly solved by PR #192 (commit 7911ac8a2b).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.

Fixes #167
2023-03-17 11:11:24 -04:00
Igor V. Kovalenko
1f700ff100 Return IntegralValue.UNKNOWN if recursed creating CompositeValue
Currently CDT would return empty CompositeValue if recursion creating for class
type is detected. If this happens inside CompositeValue.computeForFunctionCall()
and class type has fields, this leads to an attempt to assign a value to
non-existent index into empty values array.

Fix this by returning usual IntegralValue.UNKNOWN and additionally checking
whether created value is actually a CompositeValue instance.
2023-03-16 11:44:28 -04:00
Igor V. Kovalenko
74621c1048 Restore counting iterations in computeContainsDeclaration cycle detector
A follow-up change to bug 509898 missed actually incrementing the counter,
restore it now.

Fixes: 5462bac381 ("Bug 509898 - IndexFileSet.containsDeclaration is slow and is causing UI freezes")
2023-03-16 11:14:16 -04:00
Igor V. Kovalenko
0923e66b7b Handle invalid empty c++17 fold expression early
One of Qt sample snippets contain (...) as placeholder for actual user code.
Parsing that leads to invalid class cast because buildExpression would return
fold expression token marker and not a proper ICPPASTexpression.

Fix that by handling this error early as invalid fold expression.
2023-03-16 11:14:06 -04:00
Igor V. Kovalenko
6ea3d70456 Allow const-qualified arg for __atomic builtins which accept that 2023-03-16 11:08:24 -04:00
Igor V. Kovalenko
3b72e60406 Resolve typedef before checking if type is unsigned 2023-03-16 11:07:34 -04:00
Igor V. Kovalenko
f1c15e3a3d Fix assertion evaluating binary shifts of comparison op results
Currently CDT evaluates result type of comparison ops to the converted type of
their operands. When floating point values are compared and then the result is
binary shifted this trips an assertion trying to promote floating point value.

Fix this by limiting operand types of binary shifts to integral or unscoped
enumerations. Additionally fix return type of comparison op to be boolean value.
2023-03-16 11:07:34 -04:00
Igor V. Kovalenko
c69eed48e3 Defer resolving function set if target is deferred class or constructor 2023-03-16 11:07:12 -04:00
Igor V. Kovalenko
56e5da5aa5 Allow expansion with typeids in fold expression 2023-03-16 10:55:23 -04:00
Igor V. Kovalenko
a5d51f2def Fix type of value-dependent fold expression evaluation 2023-03-16 10:55:23 -04:00
Igor V. Kovalenko
4b4daec3b4 Consider variable templates while determining size of parameter pack 2023-03-16 10:55:23 -04:00
Jonah Graham
8940a9b331 Bump bundle versions changed due to new Tycho
When we update Tycho we pull in a new version of ECJ which means
we can get some differences in the class files even though
there is no difference in the source. This commit bumps
all the bundles that are affected by this.

This is kept as a separate commit from the Tycho update
because if we need to revert the Tycho update we would still
need to bump all these bundles to make jgit timestamp qualifier
happy.

Part of #320
See also #308
2023-03-14 14:02:47 -04:00
Jonah Graham
b2666eb578 Update copyright year on all features
Part of #320
2023-03-13 21:00:55 -04:00
Jonah Graham
a786552a81 Update versions of maven plugins
Part of #320
2023-03-13 14:20:50 -04:00
Jonah Graham
21e923ada7 [releng] Prepare repo for CDT 11.2 development
Part of #320
2023-03-13 13:54:48 -04:00
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
Igor V. Kovalenko
2d3ab58e0b Recognize more unary expression operators that may end template-id 2023-02-27 13:59:08 -05:00
Igor V. Kovalenko
b9e712f8d0 Test for binary expression with variable template args, bug 497931
Includes test case from comment 8 of bug 497931 with minor correction
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=497931
2023-02-27 13:59:08 -05:00
Igor V. Kovalenko
40e3314e53 Fix typo in testTemplateIDAmbiguity_341747a testing 3rd expression 2023-02-23 13:13:40 -05:00
Igor V. Kovalenko
8f2342e842 Add more C++ builtins
Add __has_unique_object_representations
    __is_aggregate
    __is_assignable
    __is_nothrow_assignable
    __is_nothrow_constructible
2023-02-23 10:44:02 -05:00
Igor V. Kovalenko
58ab28dfd1 c++17 simplify fold expression parser and fix cast-expression on sides
Simplify parser by deferring fold-expression op token check until complete
expression can be examined.

Binary expression builder already produces a chain of BInaryOperator with
cast-expression objects. Use that to restrict valid fold-expression sequence
to the one containing only cast-expression on sides.
2023-02-14 09:53:26 -05:00
Igor V. Kovalenko
04c2da4678 More tests for c++17 fold expression 2023-02-14 09:53:26 -05:00
Igor V. Kovalenko
dc8313b304 Add another integer conversion test for issue 265
Bug: https://github.com/eclipse-cdt/cdt/issues/265
2023-02-13 10:35:57 -05:00
Igor V. Kovalenko
c0220469ad Fix type conversion in unary and binary expression evaluations. 2023-02-13 10:35:57 -05:00
Igor V. Kovalenko
09ab420f17 Actually apply type conversion in CPPEvaluation maybeApplyConversion()
Currently type of parameters of instantiated template function is ignored while
preparing activation record, which makes constexpr evaluation of instantiated
body use types of arguments in function call expression instead:

    template<typename T> bool f(T t) { return t > 0; }
    t<unsigned int>(-1); // CDT returns false because conversion is not done

Fix this by applying EvalTypeId to argument if cost of standard conversions is
Rank.CONVERSION to make sure createActivationRecord() would populate activation
record with argument values matching template parameter types.
2023-02-13 10:35:57 -05:00
Igor V. Kovalenko
beb201e082 Apply truncation and sign-extension to result of initializer evaluation 2023-02-13 10:35:57 -05:00
Jonah Graham
8dd97763a3 Fix incorrect since tags 2023-02-08 21:54:37 -05:00
Jonah Graham
f8625ef447 Fix rebase error for pr #234 - C++ Fold Expressions
PR #234 had a compilation error once it was rebased which
wasn't identified until after it was rebased and merged
to main causing build to fail.

This PR is to fix that rebase error.
2023-02-07 21:49:02 -05:00
Igor V. Kovalenko
f2f862351e Add c++17 fold expression 2023-02-07 21:06:24 -05:00
Igor V. Kovalenko
c973dd5e80 Make sure AST is available to C getExpressionType too
C++ parser methods already store current lookup point which makes AST available
via thread-local variable. Do the same for C parser to enable SizeofCalculator
accessing type size macros via AST while processing C code.
2023-02-04 09:55:07 -05:00
Igor V. Kovalenko
b84b0f62eb Test arithmetic conversion from larger unsigned operand type 2023-02-04 09:55:07 -05:00
Igor V. Kovalenko
57008babd8 Fix arithmetic conversion from larger unsigned operand type
Fixes: 16944a0de7 ("Arithmetic conversions for unary and binary expressions, bug 231859.")
Closes: https://github.com/eclipse-cdt/cdt/issues/265
2023-02-04 09:55:07 -05:00
Philipp Wendler
cf834dd838 Add definitions for integer overflow builtins from GCC
Closes #271
2023-02-04 09:51:34 -05:00
Jonah Graham
a4ba7173e8 Mark DocCommentHighlightingTest as flaky
This test regularly fails on CI builds, but the test passes ok.

Fixes #259
2023-01-30 14:55:55 -05:00
Jonah Graham
ff858fee08 Convert test to JUnit5
This is a pre-requisite to be able to use flaky test tag
2023-01-30 14:55:55 -05:00
Jonah Graham
cbbbe44553 Provide a base UI test case for JUnit5
This is the analogous class to BaseUITestCase, but for JUnit5.
2023-01-30 14:55:55 -05:00
Jonah Graham
8ff58a5262 Remove field in test
The field implies that the fSourceViewer has a longer life
than it does. But reality is that the viewer is only
valid until the editor gets reopened while the test is
running.
2023-01-30 14:55:55 -05:00
Dominic Scharfe
22ee440b88 Issue #254: Constructors of inner classes not resolved properly
- add test case to reproduce #254
- add special case to detect constructors which were declared in the
index file set of the tu
2023-01-28 11:01:08 -05:00