fix #640 - Warning for variable used in ctor but not in standard func

This commit is contained in:
Basile Burg 2018-05-25 21:43:50 +02:00
parent e9d17fdc3b
commit 1cd9e9f1ea
1 changed files with 12 additions and 0 deletions

View File

@ -138,6 +138,7 @@ final class UnmodifiedFinder : BaseAnalyzer
mixin PartsMightModify!AsmPrimaryExp;
mixin PartsMightModify!IndexExpression;
mixin PartsMightModify!FunctionCallExpression;
mixin PartsMightModify!NewExpression;
mixin PartsMightModify!IdentifierOrTemplateChain;
mixin PartsMightModify!ReturnStatement;
@ -368,4 +369,15 @@ bool isValueTypeSimple(const Type type) pure nothrow @nogc
void foo(){auto e = new E;}
}, sac);
assertAnalyzerWarnings(q{
void issue640()
{
size_t i1;
new Foo(i1);
size_t i2;
foo(i2);
}
}, sac);
}