Virtual destructor : minor fix to avoid false positives when more modifiers are used

This commit is contained in:
Daniel Marjamäki 2008-12-10 19:13:40 +00:00
parent 02f3196b24
commit ddd20a2977
1 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/*
/*
* c++check - c/c++ syntax checking
* Copyright (C) 2007 Daniel Marjamäki
*
@ -718,6 +718,9 @@ void CheckClass::virtualDestructor()
while (TOKEN::Match(base, "::"))
base = TOKEN::findmatch(base->next(), "%any% ~ %var1% (", baseName);
while (TOKEN::Match(base, "%var%") && !TOKEN::Match(base, "virtual"))
base = base->previous();
// Check that there is a destructor..
if ( ! base )
{