668 Commits

Author SHA1 Message Date
Daniel Marjamäki
87ece5856a Fix Cppcheck internal warning 2019-10-01 21:37:43 +02:00
Daniel Marjamäki
cf965b72b5 SymbolDatabase: look for functions in anonymous namespaces in the findFunction 2019-10-01 19:09:34 +02:00
Daniel Marjamäki
eb8908cd3e PodType: Add test 2019-09-29 17:02:14 +02:00
Oliver Stöneberg
de9f489b08 use range loops / constness (#2181)
* use range loops / constness

* platform.cpp: avoid shadowed variable
2019-09-19 20:29:33 +02:00
Daniel Marjamäki
887e65d006 TestSymbolDatabase: Clean up code using ASSERT 2019-09-16 11:18:01 +02:00
Daniel Marjamäki
5a5cecd4d5 TestSymbolDatabase: Clean up code using ASSERT 2019-09-16 11:12:40 +02:00
Daniel Marjamäki
004b4e4dbe TestSuite: The ASSERT and ASSERT_EQUALS will now stop executing the test case upon failure. This can be used to avoid extra guard logic in tests. 2019-09-16 06:34:45 +02:00
Daniel Marjamäki
742c437953 Fixed #9354 (Unknown macro is not reported and then Cppcheck is silent about issues) 2019-09-13 13:05:48 +02:00
Daniel Marjamäki
7d63bdee6f astyle formatting
[ci skip]
2019-09-02 06:59:07 +02:00
Ken-Patrick
2c656d6586 Issue 9255: Prevent infinite recursion in parsedecl (#2134) 2019-09-01 11:36:02 +02:00
Ken-Patrick
d1c6cb9aa5 Fix issue 9304: boolean type of ternary (#2131)
* Add test cases for 9304

* Fix 9304
2019-09-01 09:51:53 +02:00
Paul Fultz II
ffdd2dc793 Fix issue 8924: Re-enable valueFlowTerminatingCondition 2019-08-05 07:18:06 +02:00
Daniel Marjamäki
c03df8e6b4 SymbolDatabase: Improved matchParameter for containers 2019-08-03 10:10:40 +02:00
Daniel Marjamäki
e66e6549ee SymbolDatabase: Improved ValueType::matchParameter handling of containers 2019-08-02 15:59:22 +02:00
Daniel Marjamäki
8deb855b41 Fix ValueType::matchParameter for 'const float *' => 'signed long long' 2019-07-31 18:55:55 +02:00
Daniel Marjamäki
c51f44ce4c SymbolDatabase: extend usage of ValueType::matchParameter for variable parameters 2019-07-31 18:24:15 +02:00
Daniel Marjamäki
1eb5f2266c ValueType::matchParameter: Fix matching of char** and void* 2019-07-31 16:23:50 +02:00
Daniel Marjamäki
a3dc2db77a SymbolDatabase: Use ValueType::matchParameter for variable address parameters 2019-07-31 12:38:36 +02:00
Daniel Marjamäki
039d49bcb1 Improve ValueType::matchParameter for pointers with different types 2019-07-31 12:12:17 +02:00
Daniel Marjamäki
728ac6ae2e SymbolDatabase: Use ValueType::matchParameter for char literal parameters 2019-07-31 09:35:32 +02:00
Daniel Marjamäki
e58e51ee14 SymbolDatabase::findFunction: For string literal, a std::string parameter is a better match than a void* parameter 2019-07-30 21:20:01 +02:00
Daniel Marjamäki
d5d50d9b17 ValueType::matchParameter: Improved constness matching 2019-07-30 09:19:51 +02:00
Daniel Marjamäki
3066c0653c Fixed #8668 (SymbolDatabase: Wrong findFunction match for const pointer argument) 2019-07-29 18:14:23 +02:00
Daniel Marjamäki
4fb6c27276 Modernize: Use enum class 2019-07-23 14:29:02 +02:00
Rikard Falkeborn
06337cedf5 Run more tests on full token list (#2020)
Since all checks are run on the full token list and not the simplified
one, run the tests on the full token list as well.
2019-07-22 10:26:55 +02:00
Daniel Marjamäki
58076bc672 SymbolDatabase: Better handling of smart pointers 2019-07-09 17:32:19 +02:00
Daniel Marjamäki
a0b22410cf SymbolDatabase: Better handling of smart pointers 2019-07-07 21:52:49 +02:00
shaneasd
7e54f989f9 Update symbol database such that the override keyword implies that the function is also virtual (#1907)
* Update symbol database such that the override keyword implies that the function is also virtual

* Add test case for implicit override

* change isVirtual to hasVirtualSpecifier

* fix method documentation for getVirtualFunctionCalls and getFirstVirtualFunctionCallStack

* Fix isImplicitlyVirtual to consider the override keyword and document logic

* Fix getFirstVirtualFunctionCallStack and getVirtualFunctionCalls to use isImplicitlyVirtual instead of isVirtual so new test case passes
2019-07-04 12:32:32 +02:00
IOBYTE
c4933acb5a Fixed #9147(SymbolDatabase bailout: unhandled code) (#1948)
* Fixed #9147(SymbolDatabase bailout: unhandled code)

* add test for #9183
2019-07-03 08:35:48 +02:00
Paul Fultz II
8f4cb36e1e Check for more garbage code (#1949)
* Check for garbage commas

* Find garbage dot operator
2019-07-03 08:28:24 +02:00
Scott Furry
a195477470 Correct Zero/Null as pointer constant (#1938)
Building with enhanced clang warnings indicated a large number of
instances with the warning:

`warning: zero as null pointer constant`

Recommended practice in C++11 is to use `nullptr` as value for
a NULL or empty pointer value. All instances where this warning
was encountered were corrected in this commit.

Where warning was encountered in dependency code (i.e. external library)
no chnages were made. Patching will be offered upstream.
2019-06-30 21:39:22 +02:00
IOBYTE
8b347aed42 Fixed #8663 (Stack overflow with template disambiguator) (#1932) 2019-06-28 22:07:21 +02:00
Daniel Marjamäki
66a61fe5e8 SymbolDatabase: Improved findFunction 2019-05-30 20:26:45 +02:00
Daniel Marjamäki
36b6fb9f4d Fixed #8558 (False portability positive caused by incorrect method resolution) 2019-05-30 19:24:51 +02:00
Daniel Marjamäki
57c6628732 Revert 'Cleaning up unsimplified templates'. This fix caused problems. 2019-05-16 21:11:04 +02:00
Daniel Marjamäki
d58d4273f9 Cleaning up unsimplified templates 2019-05-11 13:00:03 +02:00
Daniel Marjamäki
9947774ab7 Removed test case with unused templates 2019-05-05 19:15:42 +02:00
Rikard Falkeborn
1cc5f3abe7 Set wchar_t type (#1807)
This is necessary for valueflow to know the size, for example when
calculating sizeof(wchar_t).
2019-05-01 16:34:28 +02:00
IOBYTE
7799ed4243 Fixed #8889 (varid on function when using trailing return type.) (#1800)
* Fixed #8889 (varid on function when using trailing return type.)

Don't set varid for trailing return type.

* Add a test for #9066 (Tokenizer::setVarId: varid set for trailing return type)
2019-04-18 20:22:39 +02:00
Oliver Stöneberg
16ebb90b32 library.cpp: optimized Library::detectContainer() (#1778)
* library.cpp: optimized Library::detectContainer()

reduces Ir from 5882 to 1149 according to callgrind

* fixed hang in tests
2019-04-06 06:42:01 +02:00
IOBYTE
5cdde701ba template simplifier: add minimal template template support (#1779) 2019-04-04 06:07:49 +02:00
Daniel Marjamäki
b0c58f2b10 Fixed #9000 (SymbolDatabase: lambda scope) 2019-03-30 10:32:36 +01:00
Daniel Marjamäki
fe285f1df3 Fixed #9055 (SymbolDatabase: second argument is missing in the symbol database) 2019-03-30 07:44:36 +01:00
IOBYTE
b6faa11fbf Fixed #9056 ("using namespace" inside namespace causes "SymbolDatabase bailout;) (#1753)
Fixed the bailout warning and one of the varid bugs.

The trailing return type still has a varid.
2019-03-24 17:31:34 +01:00
Daniel Marjamäki
a2a216bbe3 SymbolDatabase: Improved handling of 'normal' non simplified token list 2019-03-15 19:00:42 +01:00
Daniel Marjamäki
1b4895a579 ValueType: Set ValueType for false/true 2019-03-09 17:27:27 +01:00
Daniel Marjamäki
226f0c7544 Fixed ValueType for auto variable 2019-02-27 10:28:18 +01:00
Daniel Marjamäki
d84d8885f7 SymbolDatabase: Fix TODO assertions 2019-02-24 19:11:18 +01:00
Daniel Marjamäki
ef731064bd Fixed #8964 (ValueType: auto constness) 2019-02-24 08:16:08 +01:00
Daniel Marjamäki
c855cf8682 ValueType: Better constness for auto variable 2019-02-23 18:16:18 +01:00