fix #685 - Useless final attribute detects false positives
This commit is contained in:
parent
3a859d39c4
commit
f0000f4a01
|
@ -149,12 +149,14 @@ public:
|
|||
undoBlockStatic = true;
|
||||
}
|
||||
|
||||
const bool wasFinalAggr = _finalAggregate;
|
||||
scope(exit)
|
||||
{
|
||||
d.accept(this);
|
||||
_parent = savedParent;
|
||||
if (undoBlockStatic)
|
||||
_blockStatic = false;
|
||||
_finalAggregate = wasFinalAggr;
|
||||
}
|
||||
|
||||
if (!d.attributeDeclaration &&
|
||||
|
@ -402,5 +404,14 @@ public:
|
|||
FinalAttributeChecker.MSGB.format(FinalAttributeChecker.MESSAGE.class_s)
|
||||
), sac);
|
||||
|
||||
|
||||
assertAnalyzerWarnings(q{
|
||||
class Statement
|
||||
{
|
||||
final class UsesEH{}
|
||||
final void comeFrom(){}
|
||||
}
|
||||
}, sac);
|
||||
|
||||
stderr.writeln("Unittest for FinalAttributeChecker passed.");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue