Support :: prefix in front of allocation function.
This commit is contained in:
parent
14f15d65e7
commit
7c7fcf36af
|
@ -125,6 +125,8 @@ CheckMemoryLeak::AllocType CheckMemoryLeak::getAllocationType(const Token *tok2,
|
|||
}
|
||||
if (! tok2)
|
||||
return No;
|
||||
if (tok2->str() == "::")
|
||||
tok2 = tok2->next();
|
||||
if (! tok2->isName())
|
||||
return No;
|
||||
|
||||
|
|
|
@ -408,6 +408,7 @@ private:
|
|||
void testgetcode() {
|
||||
// alloc;
|
||||
ASSERT_EQUALS(";;alloc;", getcode("int *a = malloc(100);", "a"));
|
||||
TODO_ASSERT_EQUALS(";;alloc;", ";;alloccallfunc;", getcode("int *a = ::malloc(100);", "a"));
|
||||
ASSERT_EQUALS(";;alloc;", getcode("int *a = new int;", "a"));
|
||||
ASSERT_EQUALS(";;alloc;", getcode("int *a = new int[10];", "a"));
|
||||
ASSERT_EQUALS(";;alloc;", getcode("int **a = new int*[10];", "a"));
|
||||
|
|
Loading…
Reference in New Issue