Commit Graph

1293 Commits

Author SHA1 Message Date
chrchr-github 518b6a27ab
Fix #11719 Handle lambdas in global scope (#5065)
* Fix #11719 Handle lambdas in global scope

* Capture list
2023-05-17 14:37:56 +02:00
Paul Fultz II 543b4adc8a
Fix 11682: False positive: constParameterReference with overloaded method (#5038)
* Fix 11682: False positive: constParameterReference with overloaded method

* Format
2023-05-05 11:27:15 +02:00
chrchr-github 7e0ddd3669
Set function pointer for ::f (#5028) 2023-05-02 22:53:21 +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
Oliver Stöneberg b3016f01a1
fixed some CLion inspection warnings (#4688)
* fixed some CLion "Unused global declaration" warnings

* fixed some CLion "Not implemented function" warnings

* fixed some CLion "Unused struct" warnings

* added TODO

* removed unused parameter reported by CLion

* fixed some CLion "Unused macro" warnings

* fixed some CLion "Condition is always true" warnings and a CLion "The value is never used" warning
2023-04-28 16:02:41 +02:00
Oliver Stöneberg 1cd1cbabe9
avoid some unnecessary code execution (#4962) 2023-04-28 12:42:51 +02:00
Oliver Stöneberg 0924e6616e
made some member functions static (#4966) 2023-04-28 12:29:40 +02:00
chrchr-github 96cf2b34fd
Optimize createSymbolDatabaseExprIds() (#5017) 2023-04-27 22:06:06 +02:00
chrchr-github 023e79b6c2
Fix #11459 uninitvar false positive (#5011)
* Fix #11459 uninitvar false positive

* Format
2023-04-25 21:01:44 +02:00
chrchr-github c5310fe8a2
Fix #8592 SymbolDatabase: better handling of 'using namespace' (#4974) 2023-04-22 10:23:12 +02:00
chrchr-github 5a4e43760e
Handle auto * const (#4994)
* Handle auto as first token

* Set varid when initialized by function

* Fix TODO from #11444

* Fix function parsing

* Add parentheses

* Format

* Handle auto * const

* Fix test on different platforms

* simpleMatch

* simpleMatch
2023-04-21 14:19:28 +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 31e714cded
Fix incorrect function assignment (#4977) 2023-04-19 06:53:47 +02:00
chrchr-github 87755e3bae
Fix autoNoType with function returning container, rvalue reference (#4926) 2023-04-12 22:10:10 +02:00
Daniel Marjamäki afb9e43f2a dump: write container information 2023-04-12 21:57:37 +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 01a22159b8
Fix autoNoType with std::begin() / function returning smart ptr (#4919)
* Fix autoNoType with std::begin()

* Suppress warning for const lambda

* Fix autoNoType with function returning smart ptr

* Handle more complex expression

* Fix scope with auto and smart ptr

* Handle smart pointers and iterators first
2023-04-01 09:38:40 +02:00
chrchr-github 5791561a45
Partial fix for #11543 checkLibraryFunction warning for smartpointer in container (#4900) 2023-03-27 17:50:33 +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
Paul Fultz II 7231d1cece
Update the isVariableChanged to correctly check the const bit (#4912) 2023-03-26 15:12:49 +02:00
Paul Fultz II fd8a7b9537
ValueFlow: Evaluate if statement for function returns (#4908) 2023-03-24 13:31:26 +01:00
chrchr-github 6316479782
Fix FP unusedStructMember with std::map (#4899) 2023-03-20 19:40:57 +01:00
chrchr-github 3b61ecd973
Fix FP missingOverride (#4894) 2023-03-18 16:39:45 +01:00
chrchr-github 3ccd0505cd
Enable and mitigate readability-simplify-boolean-expr (#4897) 2023-03-17 13:51:55 +01:00
chrchr-github 322a1a5e8c
Partial fix for #11378 internalAstError regressions (iscpp11init) (#4889) 2023-03-13 16:30:27 +01:00
Paul Fultz II 61e8b84578
Fix 11610: false negative: knownConditionTrueFalse with address of variable (#4883) 2023-03-12 19:57:11 +01:00
chrchr-github e2b2fc2684
Fix #10946 Debug warning: autoNoType with lambda (#4824) 2023-03-12 15:48:20 +01:00
chrchr-github 7881b99547
Fix #10259 debug: SymbolDatabase couldn't resolve all user defined types (#4879) 2023-03-10 19:04:46 +01:00
chrchr-github 49c5a5aabd
Fix #11602 "debug: Executable scope 'x' with unknown function" (#4869) 2023-03-09 20:04:55 +01:00
Mateusz Michalak 2d5cabed4b
Add std::*begin and std::*end cfg (#4796) 2023-03-09 17:06:53 +01:00
Paul Fultz II 9351eddbca
Fix 11605: FN useStlAlgo with multiple conditions (#4873) 2023-03-09 17:06:27 +01:00
Oliver Stöneberg 20db3ff368
SymbolDatabase: made `mTokenizer` and `mSettings` references (#4857) 2023-03-07 12:22:06 +01:00
Oliver Stöneberg 50eb0641b9
iwyu.yml: added `clang-include-cleaner` job / cleaned up includes based on `include-what-you-use` (#4844) 2023-03-04 08:53:19 +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 b70e1d5461
avoid some unchecked pointer dereferences (#4811) 2023-03-02 22:05:41 +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 75619db1d5
symboldatabase.cpp: use `Keywords` / added TODOs (#4828) 2023-03-02 21:20:56 +01:00
chrchr-github 072e822020
Set ValueType for free function returning iterator (#4837) 2023-03-02 21:01:20 +01:00
Daniel Marjamäki 80050b11dd SymbolDatabase: Fix handling of function pointer arguments 2023-02-27 15:10:25 +01:00
chrchr-github 29b651f264
Partial fix for #11543 checkLibraryFunction warning for smartpointer in container (#4781) 2023-02-25 15:47:02 +01:00
Oliver Stöneberg a250e6b569
enabled and mitigated `-Wunreachable-code` Clang warnings (#4818) 2023-02-24 21:57:44 +01:00
chrchr-github 92b42255da
Fix #11559 FN functionConst (#4795) 2023-02-24 21:44:57 +01:00
chrchr-github d65cc696b0
Get type from auto with scope (#4822) 2023-02-24 21:05:26 +01:00
chrchr-github a030970160
Fix #11531 FP constParameter with const/non-const overload / #8700 FP functionConst (#4802) 2023-02-24 07:05:18 +01:00
Daniel Marjamäki e5a22e3436 Revert "improved `Path` handling of mixed separators (#4808)"
This reverts commit 0797867758.
2023-02-24 06:21:02 +01:00
Oliver Stöneberg 0797867758
improved `Path` handling of mixed separators (#4808) 2023-02-23 22:34:05 +01:00
chrchr-github 1c11d3039d
Fix FP returnTempReference (#4793)
* Fix FP returnTempReference

* Fix mismatch between token and variable ValueType

* Format, clang-tidy

* Add test

* Format
2023-02-17 07:17:37 +01:00
Oliver Stöneberg 8ef14dad98
fixed and enabled `performance-faster-string-find` clang-tidy warning (#4769) 2023-02-08 21:01:51 +01:00
chrchr-github 271ccbc8f3
Fix FP constVariable with reference to std::array (#4777) 2023-02-08 08:25:43 +01:00
chrchr-github 55292d476a
Fix #11535 "debug: Executable scope 'x' with unknown function" (#4770) 2023-02-07 22:35:58 +01:00