test/cfg/ Started to test std::complex functions.

This commit is contained in:
Martin Ettl 2015-08-14 02:06:48 +02:00
parent 77869b7812
commit e9b1f1f0a6
3 changed files with 17 additions and 1 deletions

View File

@ -15,6 +15,16 @@
<not-bool/>
</arg>
</function>
<!-- std::proj(std::complex) -->
<function name="std::proj">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- double complex cproj(double complex x); -->
<function name="cproj">
<use-retval/>

View File

@ -14,7 +14,7 @@ CPPCHECK_OPT='--check-library --enable=information --enable=style --error-exitco
# Compiler settings
CXX=g++
CXX_OPT='-fsyntax-only'
CXX_OPT='-fsyntax-only -std=c++0x'
CC=gcc
CC_OPT='-Wno-nonnull -fsyntax-only'

View File

@ -12,6 +12,7 @@
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <complex>
void bufferAccessOutOfBounds(void)
{
@ -33,6 +34,11 @@ void uninitvar(void)
// cppcheck-suppress uninitvar
std::abs(i);
double d;
const std::complex<double> dc(d,d);
// cppcheck-suppress uninitvar
std::proj(dc);
// cppcheck-suppress uninitvar
std::isalnum(i);
// cppcheck-suppress uninitvar