Commit Graph

2920 Commits

Author SHA1 Message Date
chrchr 9579b4509d Partial fix for #11770 cppcheckError with unknown macro 2023-06-15 18:36:21 +02:00
Daniel Marjamäki 9339802be3
Fix #11740 (FP syntaxError from switch in C code) (#5153) 2023-06-14 10:41:37 +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 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 18b60d2f2b
Fix #11670 FP constStatement (inconclusive) triggered by namespace (#5114) 2023-06-03 15:13:15 +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
chrchr-github beea1a2345
Fix #11689 FP constStatement with nested typedefs (#5090)
* Fix #11689 FP constStatement with nested typedefs

* Add test
2023-05-26 06:12:40 +02:00
Daniel Marjamäki 107eea236f
Improved handling of alignas. alignas will not be removed from now on so we don't loose this information. (#5081) 2023-05-24 10:33:53 +02:00
Stefan Hagen 9e8cb6904a
[nit] Fixed lib/tokenize.cpp:2815:2: warning: extra ‘;’ [-Wpedantic] (#5071)
Single character fix removing extra semi colon.
2023-05-23 06:27:25 +02:00
chrchr-github 33f728df14
Fix #11725 Hang in simplifyTypedef() with extra parentheses (#5078)
* Fix  #11725 Hang in simplifyTypedef() with extra parentheses

* Amend test
2023-05-23 06:26:22 +02:00
chrchr-github 78182d4773
Fix FN constVariablePointer (#5076)
* Fix FN constVariablePointer

* Fix FP

* Add const

* Fix tests

* Add const
2023-05-22 19:53:51 +02:00
chrchr-github ba57e15cb2
Fix #11717 Warn when C++ code is scanned as C (prevent FPs) (#5064)
* Fix #11717 Warn when C++ code is scanned as C (prevent FPs)

* Don't throw for operators

* Detect reference variables

* Fix tests

* Fix compilation

* Fix test

* Fix another test

* Use strAt()
2023-05-21 13:59:49 +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 d475591665
Tokenizer: simplification of typedefs in _Generic arguments (#5059) 2023-05-14 15:14:52 +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
Daniel Marjamäki d24a1342a6
Fixed #11711 (Tokenizer: varId not set properly in function call) (#5041) 2023-05-08 12:11:30 +02:00
Paul Fultz II 9d21379c7d
Add non-const overloads for next(), previous(), and link() (#5002)
* Add non-const overloads for next(), previous(), and link()

* Format

* Add CPPCHECKLIB
2023-05-02 06:55:31 +02:00
Paul Fultz II 86757de4d5
ValueFlow: Add pass runner to check timeout and report time (#4952) 2023-04-30 20:39:05 +02:00
chrchr-github 043f4fa621
Fix #11693 performance regression (hang) in 2.11dev (#5022) 2023-04-29 15:17:55 +02:00
chrchr-github 5b4c95f229
Fix varid assigned to function (#4991) (#5013) 2023-04-28 08:27:07 +02:00
chrchr-github 9c184462ad
Fix #10720 Hang/Crash with big variadic template (#5018)
* Fix #10720 Hang/Crash with big variadic template

* Fix CI
2023-04-28 08:26:35 +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
chrchr-github bda9f707cc
Fix typedef in enum class (#4998) 2023-04-21 18:58:44 +02:00
chrchr-github a4e224b65c
Handle auto as first token, set varid (#4991)
* Handle auto as first token

* Set varid when initialized by function

* Fix TODO from #11444

* Fix function parsing

* Add parentheses

* Format
2023-04-21 10:13:25 +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
chrchr-github 29e2a7ed34
Fix #11640 internalAstError with typedef matching member function [regression] (#4981) 2023-04-18 18:38:16 +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
Daniel Marjamäki afb9e43f2a dump: write container information 2023-04-12 21:57:37 +02:00
Daniel Marjamäki e59e34c0eb showtime: separate items properly 2023-04-11 19:52:55 +02:00
Daniel Marjamäki 3eeeaeffd2 Tokenizer::simplifyTypedef: ensure externC flag is preserved when simplifying typedefs 2023-04-09 09:38:12 +02:00
chrchr-github 5524bb4e58
Fix #11634 Crash in TypedefSimplifier (#4938)
* Fix #11634 Crash in TypedefSimplifier

* Call function

* Format
2023-04-07 11:09:13 +02:00
chrchr-github b2b0962067
Fix #11629 debug: Scope::checkVariable found variable 'np' with varid 0. (#4915) 2023-04-03 15:41:19 +02:00
chrchr-github a336048d14
Fix #11599 false negative: constParameter (#4902)
* Partial fix for #11599 false negative: constParameter

* Adjust test

* Update testother.cpp

* Update testother.cpp

* Fix #11599 false negative: constParameter

* Fix new warnings

* Format

* Add difference_type

* Remove isAliased()

* Undo

* Adjust test

* Add test

* Improve const check

* Tweak constness, add tests

* Add tests

* Use new helper function, fixtest

* Remove bailout, fix check for cast

* Prevent FP

* Fix constVariable check, add tests

* Format

* Format

* Add test for #11632
2023-04-02 20:36:23 +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 13e12da08f
Fix #11639 findGarbageCode(): SIGSEGV (#4917) 2023-03-28 11:24:52 +02:00
Daniel Marjamäki c79d859f8b Tokenizer::simplifyTypedef: new faster simplification.
It performs a more "lightweight" simplification of global typedefs that are not shadowed.

If a "heavy" simplification is needed that will be executed afterwards.
2023-03-26 17:16:45 +02:00
chrchr-github 3ccd0505cd
Enable and mitigate readability-simplify-boolean-expr (#4897) 2023-03-17 13:51:55 +01:00
chrchr-github 980c92d19d
Partial fix for #11378 internalAstError regressions (iscpp11init) (#4884) 2023-03-12 15:39:02 +01:00
chrchr-github 809430631f
Partial fix for #11611 FP constStatement with typedef and unknown macro (#4881) 2023-03-12 11:13:58 +01:00
Mateusz Michalak 2d5cabed4b
Add std::*begin and std::*end cfg (#4796) 2023-03-09 17:06:53 +01:00
Daniel Marjamäki b0e8ed3117 dump: add more template info to dumpfile 2023-03-08 18:59:34 +01:00
Oliver Stöneberg 20db3ff368
SymbolDatabase: made `mTokenizer` and `mSettings` references (#4857) 2023-03-07 12:22:06 +01:00
Oliver Stöneberg a3cacf1ba1
TemplateSimplifier: made `mTokenizer` and `mSettings` references (#4856) 2023-03-07 12:12:31 +01:00
Daniel Marjamäki e8e00d8fdf Unused Var: Fix FP when initialization is made in macro 2023-03-05 15:31:53 +01:00
Daniel Marjamäki f4e0ae3b84 Tokenizer: Improved removing of function pointer arguments to avoid false positives 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