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

70 commits

Author SHA1 Message Date
Nathan Ridge
a00346af22 Bug 540112 - Perform C++14 return type deduction in ReturnChecker
As part of this change, ReturnChecker was refactored to compute the
return type as an IType, which allowed for removal of some logic in
ReturnChecker which duplicated CPPVisitor's type resolution work.

Change-Id: I9cd8512164d650a5ee11d2e58fdae477e3c428a2
2018-10-28 22:52:37 -04:00
Marc-Andre Laperle
efbda46cba Bug 389577 - False positive "Unused static function"
Add handling of constructor/destructor attributes and some improvement
when functions were previously declared but not defined as used.

Change-Id: I7537bc87c6c4bc5b294d8e15fe5b42c92b3f2974
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2018-10-11 22:43:20 -04:00
Bassem Girgis
ae8442fd6d Bug 519311 Handle delegating constructor in class template
- Fixed delegating constructor resolution for templated classes in
ClassMembersInitializationChecker
- Added a unit test for this bug

Change-Id: Idb072ec05e66e0f10af53db8258459ad14f7f329
Signed-off-by: Bassem Girgis <brgirgis@gmail.com>
2018-10-10 00:09:22 -04:00
Bassem Girgis
9c04b1bcf7 Bug 519473 Fixed member function calling with references
Change-Id: I86d1dfacb6f842be688bfdaf2a6a0faf0ffade09
Signed-off-by: Bassem Girgis <brgirgis@gmail.com>
2018-10-09 23:57:48 -04:00
Marc-Andre Laperle
467aab5559 Bug 539307 - Set correct project nature in Codan tests to fix wrong content type
When the lsp4e-cpp plugin is present, two content types are associated with
.cpp extension. The lsp4e-cpp one is chosen because it happens to be first.
Normally, the CDT C++ content type gets its priority boosted when the C++
project nature is present. Some Codan tests run on .cpp files but without
the C++ project nature so the files are of wrong content type and the tests
fail. Once the nature is fixed, some tests were failing because they should
run on C files but loadCode was not loading them as C++ files because of the
project nature.

Change-Id: I61b77d409e81c3cf78e60adf0c77a9bf976ac9d5
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2018-09-30 19:26:25 -04:00
Nathan Ridge
fa50ca7bc0 Bug 536268 - Find uses of overloaded operators when checking for unused symbols
Change-Id: I4445b62d4419ffa12d505bcc8265492c22f49bb6
2018-07-07 20:17:13 -04:00
Felix Morgner
5ec251a791 Bug 532120: Catch by const reference ignores const placement setting
The original implementation used plain-text string manipulation of the
IDocument. This changeset changes the implementation to make use of the
ASTRewrite infrastructure, which automatically honors the const
placement setting.

Change-Id: Ib5ae9381b93ca8ab4d1ad3e16b1c3c8b1ec62d78
Signed-off-by: Felix Morgner <fmorgner@hsr.ch>
2018-06-03 06:37:37 -04:00
Nathan Ridge
c8b769ead2 Bug 534332 - Add a testcase involving a function as well
Change-Id: I02c4ec4ab2ece8dee09ba6b27461dc76724ebba8
2018-05-17 20:28:36 -04:00
Nathan Ridge
45bbb2bb5b Bug 534332 - In the unused symbol checker, check for 'unused' attribute on the decl-specifier too
Change-Id: Ib4f26e5a04742af93c884819a5b2f1f714faeb97
2018-05-10 22:47:43 -04:00
Felix Morgner
47ceed3cbe Bug 525250: "Create local variable" offered outside of local scopes
When invoked from within 'isApplicable(IMarker)', 'isCodanProblem()' did
not work as expected, since it used a cached value that was only updated
in 'run(IMarker)'. The old API 'isCodanProblem()' has been marked as
deprecated and is replaced by 'isCodanProblem(IMarker)', which works
directly on the marker, instead of using a cached result.

Additionally, two new APIs in 'QuickFixTestCase', called
'calculateQuickFixApplicability()' and
'assertIsApplicableForAllMarkers(boolean)', are introduced. The former
can be used to record the applicability of the QuickFix under test for
every marker in the test code, while the latter provides a way to assert
on the applicability. For finer grained assertions,
'calculateQuickFixApplicability()' returns the calculated map.

Change-Id: I7c53fd26afefa37ff086559acea75a7a33ecd5d7
Signed-off-by: Felix Morgner <fmorgner@hsr.ch>
2018-03-14 09:30:42 +01:00
Alena Laskavaia
ce18aad766 Bug 350144 - suppressing the "No break" problem with regexp
added regex support for suppression comment

Change-Id: I590d171fcce23d547a489e42a791aa484963d4a6
Signed-off-by: Alena Laskavaia <elaskavaia.cdt@gmail.com>
2017-12-26 15:08:20 -05:00
Hansruedi Patzen
a4dcbbaf15 Bug 527553: Detect invalid decltype(auto) with a type specifier
The evaluated type of 'decltype(auto)' in combination with const and/or
volatile will be a ProblemType since this is not valid code. The patch
also contains a checker to give the user a visual feedback.

Note: A proposed quick-fix has been removed after a short discussion.

Change-Id: I8760ed0ac28e28529ab30516accac9c0413c87d9
Signed-off-by: Hansruedi Patzen <hansruedi.patzen@hsr.ch>
2017-11-30 14:56:02 -05:00
Hansruedi Patzen
19b4848e08 Bug 527709 - [Checker] Test suite fails on Windows
Change-Id: I70cf18245dc8dba14493f212c932ea08ae85a6cf
Signed-off-by: Hansruedi Patzen <hansruedi.patzen@hsr.ch>
2017-11-24 10:44:11 +01:00
Felix Morgner
d47cb6c4ea Bug 495842: Add a quick fix for codan problems that ignores them by adding a @suppress comment
Change-Id: I760d2d435010f219bdb94273a6450e4163fe472e
Signed-off-by: Felix Morgner <fmorgner@hsr.ch>
2017-10-04 11:13:54 -04:00
Nathan Ridge
bd6da0b03d Bug 486082 - Have ProblemBindingChecker report errors of type IProblemBinding.SEMANTIC_INVALID_TYPE
Change-Id: I58f27a8783ea0dca53da5b45c2da11c6623892fd
2017-06-19 00:26:59 -04:00
Nathan Ridge
60503efc58 Bug 512932 - Improve type checking of GCC builtins
Specifically, this patch:

  - Adds support for a new builtin, __builtin_assume_aligned.

  - Models __builtin_constant_p as a function instead of a macro.
    This inhibits constexpr evaluation, but allows for correct
    type-checking.

  - Diagnoses misuses of known builtins, instead of ingoring them like
    unknown builtins.

Change-Id: Ie5a26f2010dc5b19e6f32a8c6a1237fe88da393e
2017-05-08 23:04:17 -04:00
Rolf Bislin
a583190f52 Bug 514685 - codan: handle fallthrough attribute
and provide quickfix for adding fallthrough attribute
and add JUnit Tests
and add StandardAttributes class

Change-Id: I8cf0238771dc92bd1784b9dfb35a680d078b1db6
Depends-On: Ic09aa96f896b0a5dd998156e05930704775f695b
Signed-off-by: Rolf Bislin <romibi@bluewin.ch>
Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
2017-05-08 13:25:15 -04:00
Thomas Corbat
db6790d824 Bug 515814 Copyright header for CaseBreakQuickFixCommentTest
Associated with Bug 515814


Change-Id: Id32b0e8a77a774ff8922aa289a457e4f63434ecd
Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
2017-05-01 10:09:14 +02:00
romibi
525d8a23fb Bug 515814 - codan: add missing JUnit Test
Change-Id: I626811b33ed09bb07c947c1c491b2c04e282232b
Signed-off-by: romibi <romibi@bluewin.ch>
2017-04-26 11:35:25 -04:00
Marc-Andre Laperle
0046099052 releng: Make use of Tycho POM-less functionality
This removes a lot of pom.xml from the source tree. This is using the
"POM-less" Tycho functionality.
See
https://wiki.eclipse.org/Tycho/Release_Notes/0.24#POM-less_Tycho_builds

One advantage of this is that you do not need to update the version in
the pom.xml when you change it in the MANIFEST.MF because the pom.xml is
automatically generated. This also reduces a lot of the duplicated
information and pom.xml repetition.

- Maven 3.3 and up is required.
- Only eclipse-plugins and eclipse-features can be pom-less.
Repositories, target and others still have pom.xml.
- New parent poms are added because a parent is necessary directly one
level above the plug-in/feature that will have its pom generated
- Some test plug-ins had to be renamed .test -> .tests because it's
required so that it detects that it's a test plug-in
- Some suites were renamed so that they all use the same consistent name
"AutomatedIntegrationSuite"
- Profiles were added for the more common test configurations. They are
activated by the presence of simple .properties files that only serve to
activate the correct profile. The profiles:
  - One for UI tests (UI present and start in UI thread)
  - One for SWTBot tests (UI present and do not start in UI thread)
Other test plug-ins that are too different are kept intact and still
have
a pom.xml
- Fragments are kept intact since they all have different target
platform configurations

Change-Id: I9d73380eb766f547830c552daf08053a30b1845c
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-02-13 23:19:56 -04:00