The following snippet triggerd the error:
template<typename DerivedT>
template<typename T>
auto ComposableParserImpl<DerivedT>::operator|( T const &other ) const -> Parser {
return Parser() | static_cast<DerivedT const &>( *this ) | other;
}
Whenever simplifyFunctionParameters was called on a templated class'
templated member function (and probably any nested template), the
tokenizer would recognise it as a syntax error, assuming that return
type *must* come after a template<> token.
Add function configurations with tests for:
GetLocalTime, GetSystemTime, GetLastError, SetLastError,
AllocateAndInitializeSid, FreeSid, HeapAlloc, HeapReAlloc, HeapFree,
HeapSize, HeapValidate and GetProcessHeap.
test/cfg/runtests.sh: Enable --inconclusive for the windows tests to
avoid some issues in the future.
Add configuration for the deprecated strlwr/strupr functions with
according warning.
test/cfg/windows.cpp: Added tests for strlwr and strupr. Moved function
call that does not return (FreeLibraryAndExitThread) to the end of the
function to fix analysis that was silently aborted at that point
(reported as issue #8378).
Add formatting of the configuration files (cfg/*.cfg) if the xmllint
binary is found.
Changed windows commands and arguments to uppercase to be consinstent.
Silenced the output of commands that is not interesting.
Tested with the xmllint binaries and libraries found here:
ftp://ftp.zlatkovic.com/libxml/
There is a potential `nullPointer` dereference in symboldatabase. This PR attempts to fix this. Additionally, this could be detected by Cppcheck as well.
Here is a reduced and compilable testcase, where Cppcheck fails to detect a potential `nullPointer` dereference:
```
class Scope
{
public:
bool bar();
int *definedType;
};
int f(Scope *new_scope)
{
int ret = 1;
if (new_scope)
{
if (new_scope->bar())
{
if (!new_scope->definedType) {} // check for null
ret = *new_scope->definedType; // dereference
}
}
return ret;
}
```
The corresponding ticket on track, addressing the false negative: https://trac.cppcheck.net/ticket/8375
* posix library: Add strtok tests
In the posix library there is the same configuration for strtok but a
warning is added.
* posix.cfg: Remove redundant configuration for strtok, add comment.
* checkio: Fixed potential usage of invalid iterator.
* formatted the code.
A ticket about FN (invalidIterator1) is created at https://trac.cppcheck.net/ticket/8373
* Fixes issue with case inside switch that is not a compound statement was treated as garbage
This fixes an issue with the check for case keywords outside of switch
detection that would treat a case statement inside a switch that is not
a compound statement as garbage, but this is perfectly valid C++. This
construct is used in several libraries, i.e. Google Test.
* Tweak check and handle missing semicolon
Tweaks the check with feedback from danmar.
Handle the case where there is no semicolon and document it with a unit
test.
Implemented tests for the following windows configurations (more will
follow):
-Semaphore usage
-lstrcat function configuration
-_countof macro configuration
-Mutex usage
-Library usage (LoadLibrary, GetProcAddress, ...)