Commit Graph

1670 Commits

Author SHA1 Message Date
chrchr-github 9b892f3239
Partial fix for #11552 Handle lambda return types (#5188) 2023-06-25 12:01:59 +02:00
chrchr-github 9a95d4fe67
Fix #11785 Syntax error: typedef not first keyword in statement (#5178) 2023-06-21 18:26:28 +02:00
chrchr-github bb962e2bc3
Enable and mitigate readability-else-after-return (#5175) 2023-06-20 18:43:21 +02:00
chrchr-github 082331c210
Fix #11770 cppcheckError for unknown macro after else (#5163) 2023-06-17 18:39:23 +02:00
chrchr-github 62dfa8877c
Merge pull request #5147 from chrchr-github/chr_astregr
Fix AST regression
2023-06-16 22:47:47 +02:00
chrchr 39d60ca63e Add test 2023-06-15 18:53:42 +02:00
chrchr 9579b4509d Partial fix for #11770 cppcheckError with unknown macro 2023-06-15 18:36:21 +02:00
chrchr fad1f6b559 Fix AST regression 2023-06-13 14:32:31 +02:00
chrchr-github 7e0f64688f
Fix #11275 internalAstError on C++20 templated lambda / Fix #11400 internalAstError on nested lambda (#5134)
* Fix #11275 internalAstError on C++20 templated lambda

* Fix #11400 internalAstError on nested lambda passed as argument
2023-06-10 07:42:10 +02:00
chrchr-github d4705ca8ab
Fix #10809 cppcheckError Cyclic reverse analysis (#5137)
* Fix #10809 cppcheckError Cyclic reverse analysis

* Handle fixed AST in ValueFlow, fix FN

* Remove
2023-06-10 07:41:52 +02:00
Daniel Marjamäki 22e67d3534
Fixed #10442 (AST: wrong ast of ({}) in struct initialization) (#5135) 2023-06-09 22:31:14 +02:00
chrchr-github 901b775471
Fix scope for function returning rvalue reference, insert std:: in return statement (#5119)
* Fix scope for function returning rvalue reference

* Insert std:: in return statement

* Fix failing test
2023-06-08 07:47:21 +02:00
chrchr-github 3ff8ce316c
Fix AST for parameter pack (#10199, #10492, #11103) (#5125)
* Fix AST for parameter pack (#10199, #10492, #11103)

* Skip ... after )
2023-06-07 20:46:14 +02:00
Daniel Marjamäki 5976faaaf5
Fixed #11745 (Fix AST for 'new type..[..]{..}') (#5118) 2023-06-05 20:43:17 +02:00
chrchr-github 774123d28d
Remove hardcoded lists of functions/templates/types (#5069)
* Remove hardcoded list of functions

* Remove hardcoded list of templates

* Remove hardcoded list of types

* Format

* Fix test

* Unused variable

* Add tests

* auto -> int
2023-05-28 14:33:41 +02:00
Daniel Marjamäki f72db74817
Fixed #11013 (FP overlappingWriteUnion with anonymous struct in union) (#5067) 2023-05-20 10:34:42 +02:00
Daniel Marjamäki 793d6aef01
Tokenizer: do not report unknownMacro for alignas (#5058) 2023-05-14 15:14:41 +02:00
Daniel Marjamäki 2b74a2084e
Fixed #11716 (simplifyTypedef: function with const should be handled better) (#5054) 2023-05-12 20:39:08 +02:00
chrchr-github f5b1537ed1
Fix internalASTError with decltype() (#5047) 2023-05-11 14:35:23 +02:00
Daniel Marjamäki d5951fa2b9
Tokenizer: Add attribute for exported symbols (#5043) 2023-05-09 20:15:00 +02:00
Oliver Stöneberg 25183ff484
testrunner: more `SettingsBuilder` usage and `const` cleanups (#5026) 2023-05-02 15:54:19 +02:00
Oliver Stöneberg 2935c855c3
reduced usage of mutable `Settings` objects in tests (#4798) 2023-05-02 11:48:24 +02:00
chrchr-github 9ea223b367
Fix #11309 debug: Scope::checkVariable found variable 'v' with varid 0 (#5006)
* Fix #11309 debug: Scope::checkVariable found variable 'v' with varid 0

* Format
2023-04-24 20:27:10 +02:00
Oliver Stöneberg db955a13a9
moved test-only `Preprocessor::getcode()` out of `lib` (#4993) 2023-04-22 10:22:00 +02:00
Oliver Stöneberg ad464c4feb
Preprocessor: relaxed dependency on `Suppressions` (#4983)
* Preprocessor: cleaned up `missingInclude()`

* Preprocessor: relaxed dependency on `Suppressions` / adjusted `TestPreProcessor::inline_suppression_for_missing_include()` which was not testing production behavior

* test/cli/test-other.py: added test for `missingInclude` and `missingIncludeSystem` inline suppressions

* fixed `constParameterReference` selfcheck warning
2023-04-21 10:14:34 +02:00
chrchr-github e17af6d2d8
Report unknown macro (#4990) 2023-04-20 17:55:16 +02:00
chrchr-github bf3be95046
Fix #11453, #11490 internalAstError with templates (#4986)
* Fix #11490 internalAstError with unknown template in index expression

* Comment

* Fix #11490
2023-04-19 21:20:57 +02:00
tsteven4 4183336dc1
fix skipping of cpp attributes. (#4971)
* fix skipping of cpp attributes.

* fix simplifyCPPAttribute loop.

When the first token was the start of a c++ attribute on a function,
so that tok->previous() was nullptr at the bottom of the loop,
an extra token would be skipped.  This could result in the corresponding
function being omitted from the symbol table.

* fix alignas test failure, enhance cpp attr test.

* uncrustify.

* fix redundantNextPrevious

* delete redundant code.

* add some tokenizer tests for simplifyCPPAttribute.

* enhance noreturn symbol test.

The order of a noreturn attribute and another attribute used to
matter.  Test both orders.
2023-04-17 20:36:25 +02:00
Oliver Stöneberg 5be8eee943
iwyu.yml: use a distro which has the latest `include-what-you-use` / enabled Qt mappings / cleaned up includes (#4885) 2023-04-08 16:08:47 +02:00
chrchr-github 89ec148199
Partial fix for #11638 Library::getFunctionName: SIGSEGV (#4920)
* Partial fix for #11638 Library::getFunctionName: SIGSEGV

* Fix test

* simpleMatch()
2023-03-30 07:25:26 +02:00
chrchr-github 322a1a5e8c
Partial fix for #11378 internalAstError regressions (iscpp11init) (#4889) 2023-03-13 16:30:27 +01:00
chrchr-github 980c92d19d
Partial fix for #11378 internalAstError regressions (iscpp11init) (#4884) 2023-03-12 15:39:02 +01:00
Oliver Stöneberg 901b2ab838
Preprocessor: provide suppressions separately from settings (#4878) 2023-03-09 20:15:53 +01:00
chrchr-github 6e1cc11eff
Fix #11606 internalAstError with empty initializer list (#4875) 2023-03-09 20:01:06 +01:00
Daniel Marjamäki 350a1f2dfc AST: do not produce AST for function pointer declaration 'void *(*var[2])(int)' 2023-03-04 11:09:55 +01:00
Oliver Stöneberg 5af6ca6637
made `Platform` a member of `Settings` instead of inheriting from it / cleanups (#4791) 2023-03-03 18:36:27 +01:00
Oliver Stöneberg bd1ae69b00
cleaned up includes based on `include-what-you-use` (#4599) 2023-03-02 21:50:14 +01:00
Oliver Stöneberg 3ec4da0f8a
improved library loading in tests (#4806) 2023-03-02 21:10:51 +01:00
Daniel Marjamäki cfba046408 Fixed #11593 (function pointer => false negatives (ast? valueflow?)) 2023-03-02 20:08:22 +01:00
Daniel Marjamäki 65fc31cba9 Tokenizer: tweaked simplification of function pointers. Argument types are kept. 2023-02-26 18:03:24 +01:00
chrchr-github a0cc35e3fa
Remove simplifyQtSignalsSlots(), update qt.cfg (#4807) 2023-02-25 15:58:57 +01:00
chrchr-github 103ff907b6
Fix #11572 Broken AST with brace-init and bitwise and (#4812) 2023-02-24 06:31:20 +01:00
chrchr-github 33a03f2c35
Don't throw internalAstError for parameter pack in template argument list (#4773) 2023-02-15 19:43:18 +01:00
Oliver Stöneberg 132a5a31cf
improved setting of platform in tests / also improved platform tests (#4787)
* fixture.h: added TODO

* TestPlatform: improved tests for built-in platforms

* TestPlatform: changed tests to TODO asserts

* testfilelister.cpp: added TODO

* fixture.h: added `PLATFORM` macro to load platform / use `PLATFORM` in tests

* platform.h: corrected capitalization in `Platform::platformString(PlatformType)` and bail on unknown type

* fixture.h: fixed `readability-redundant-string-cstr` clang-tidy warning

* testplatform.cpp: fixed `functionConst` selfcheck warnings
2023-02-11 10:44:56 +01:00
chrchr-github 1fcea5fb03
Don't crash on C++23 code (#4771) 2023-02-07 22:36:42 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 1d3955bd92
renamed some files in the `test` folder (#4705) 2023-01-27 08:18:32 +01:00
chrchr-github ca0c13e27d
Fix crash in iscpp11init_impl() (#4743) 2023-01-26 22:25:49 +01:00
chrchr-github 84fdc08853
Fix #11515 internalAstError with chain of ternary operators (#4742) 2023-01-26 20:12:39 +01:00
chrchr-github c50339804b
Fix internalAstError with switch/case (#4739) 2023-01-26 20:11:45 +01:00