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
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
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>
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.
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.
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.
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>
This change synchronizes access to LaunchBarManager.descriptors, to
avoid a ConcurrentModificationException when adding descriptors for 2
launches at the same time.
Fixes: #262
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.
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.
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
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.
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
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
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.