Merge branch 'has-public-examples-deprecated' into phobos

This commit is contained in:
Sebastian Wilzbach 2018-03-30 11:21:13 +02:00
commit 0ef3df1fd6
1 changed files with 12 additions and 0 deletions

View File

@ -44,6 +44,12 @@ class HasPublicExampleCheck : BaseAnalyzer
// check all public top-level declarations
foreach (decl; mod.declarations)
{
if (decl.attributes.any!(a => a.deprecated_ !is null))
{
lastDecl = null;
continue;
}
if (!isPublic(decl.attributes))
{
checkLastDecl();
@ -316,6 +322,12 @@ unittest
unittest {}
}, sac);
// deprecated symbols shouldn't require a test
assertAnalyzerWarnings(q{
///
deprecated void dirName(C)(C[] path) {}
}, sac);
stderr.writeln("Unittest for HasPublicExampleCheck passed.");
}