fix #588 - trust_too_much false positive with alias decl

This commit is contained in:
Basile Burg 2018-04-03 07:34:10 +02:00
parent cb31d2501e
commit 873c8f506a
1 changed files with 13 additions and 0 deletions

View File

@ -61,6 +61,15 @@ public:
d.accept(this);
checkAtAttribute = oldCheckAtAttribute;
}
// issue #588
override void visit(const AliasDeclaration d)
{
const oldCheckAtAttribute = checkAtAttribute;
checkAtAttribute = false;
d.accept(this);
checkAtAttribute = oldCheckAtAttribute;
}
}
unittest
@ -132,5 +141,9 @@ unittest
}
}c , sac);
assertAnalyzerWarnings(q{
alias nothrow @trusted uint F4();
}c , sac);
stderr.writeln("Unittest for TrustTooMuchCheck passed.");
}