1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00
Commit graph

36038 commits

Author SHA1 Message Date
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
Jonah Graham
6776f6a1ee Fix maven at 3.8.7
Until we update Tycho to 3.0.3+ we use the older Maven

Thanks to @ghentschke for figuring this out in
f7761791be

Fixes #308
2023-03-06 20:24:55 -05:00
Jonah Graham
d4c87cef72 Run workflows on CDT 11.1 branch 2023-03-06 14:11:48 -05:00
Jonah Graham
aa6547fe50 [releng] 2023-03 RC1 dependencies 2023-02-27 18:58:00 -05: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
Lisa-Marie Saru
48b9774fbd Add null check for Disassembly view source
Disassembly view is expected to be populated with lines that are fetched from a given source file. There might be the case where instructions on what lines to append are wrong. This results in a null response that will propagate through the code leading to a NPE.

The current commit is proofing the code from NPE by:
- removing the source position of the lines that were not found within the given file
- null checking the source before becoming a key element in the code flow
- adding logging if expected lines are not found in the given file

Resolves: #287
2023-02-23 14:23:24 -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
Jonah Graham
ab721eed87 [releng] 2023-03 M3 dependencies 2023-02-21 15:08:38 -05:00
Jonah Graham
4bc687b83b Add .clangd file to simplify project sharing with non-CDT
In the example CMake project add a .clangd to enable pointing
clangd at the appropriate compilation database without having
to make a copy of it.
2023-02-16 12:12:56 -05:00
Jonah Graham
cb367f063e [releng] Make it easier to run cleanup scripts out of tree 2023-02-15 21:34:45 -05:00
Jonah Graham
78f437da94 [releng] Update to snapshots of LSP4E and TM4E 2023-02-15 20:40:18 -05:00
Erwin Waterlander
920f7d85a5 New API to custom parse #define lines from GCC during scanning
Option to override the matching of macro defines for the Core Build
GCC toolchain. This may be needed for custom compilers.

Also-by: Jonah Graham <jonah@kichwacoders.com>
2023-02-15 11:59:49 -05:00
Igor V. Kovalenko
590906a005 Fix codan return value check with typedef return and template function 2023-02-15 10:25:37 -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
6ee2ce2525 Fix missing plugin.properties 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
Simeon Andreev
eb083f8cdd Clean up for synchronization of LaunchBarManager.descriptors
This change makes LaunchBarManager.descriptors a synchronized map,
slightly reducing the extra code and complexity added for #262.

Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
2023-02-06 10:41:08 -05:00
Simeon Andreev
5bb96b2f88 Prevent CME in LaunchBarManager
This change synchronizes access to LaunchBarManager.descriptors, to
avoid a ConcurrentModificationException when adding descriptors for 2
launches at the same time.

Fixes: #262
2023-02-04 09:59:20 -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
Jonah Graham
e157c2fbfe Update to 2023-03 M2 requirements 2023-01-30 10:32:49 -05:00
Dominic Scharfe
d5001624cb Extract macro argument location
The previous commit in this series addresses the NPE that
can be hit. This code covers the case of the OP in #251
to actually find the correct expression to pass to GDB.

Improvement to #251
2023-01-30 09:55:52 -05:00
Jonah Graham
af9b7b5b69 Prepare o.e.cdt.debug.ui for CDT 11.1.0 development 2023-01-30 09:55:52 -05:00
Jonah Graham
225cf469ca Document an internal method to make it easier for the next editor
While working on #251 I had to understand what this code did,
I include the method javadoc in the hope it saves the next person
who touches this code some time.
2023-01-30 09:55:52 -05:00
Jonah Graham
db84fe490d Handle case where AST name has no location
In cases where an IASTName has no image location we were getting
NPEs in this code. See javadoc for getImageLocation for cases
when image location can be null. See #251's description for a
full case of when this can happen.

All other calls to IASTName.getImageLocation in CDT were also checked
and this was the only place in the code where the return value
was not checked for null.

Fixes #251
2023-01-30 09:55:52 -05:00
Jonah Graham
b7fac2cfaf
Remove unneeded escapes in markdown 2023-01-28 20:57:31 -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
Jonah Graham
34f1736317 Re-read the makefile targets when a project becomes eligible
Without this change when the project is not a "hasTargetBuilder" then
the projectMap will contain an entry mapping the project to
an empty set of makefile targets. So when we get a project added,
make sure to re-read the target settings by clearing the cached
versions.

Fixes #244
2023-01-28 10:54:45 -05:00
Igor V. Kovalenko
fe7a9d7856
Do not allow structured binding initializer referencing introduced name (#241)
If name lookup ends up with a variable, additionally check if node being
resolved is part of the structured binding initializer introducing found
variable. If this is the case, produce problem binding and report structured
binding declaration error via codan.

This change also prevents infinite recursion trying to resolve auto type of
introduced variable while evaluating such problematic initializer.
2023-01-28 10:54:09 -05:00
Igor V. Kovalenko
2776d17014 Drop three-way comparison from C parser, this is C++ only. 2023-01-28 10:52:07 -05:00
Igor V. Kovalenko
a90cbe1736 Add simple evaluation for c++20 three-way comparison 2023-01-28 10:52:07 -05:00
Jonah Graham
a0f91038e0 Add and correct since tags for new API in 8.1.0
o.e.cdt.core 8.0.0 was released as part of CDT 11, so this new
non-breaking API needs a version bump to 8.1.0.
2023-01-28 10:52:07 -05:00