fix false warning on top level struct/union
This commit is contained in:
parent
9b97b7d929
commit
d9b6828205
|
@ -159,7 +159,7 @@ public:
|
||||||
if (d.classDeclaration || d.structDeclaration || d.unionDeclaration)
|
if (d.classDeclaration || d.structDeclaration || d.unionDeclaration)
|
||||||
{
|
{
|
||||||
_finalAggregate = isFinal;
|
_finalAggregate = isFinal;
|
||||||
if (savedParent == Parent.module_)
|
if (_finalAggregate && savedParent == Parent.module_)
|
||||||
{
|
{
|
||||||
if (d.structDeclaration)
|
if (d.structDeclaration)
|
||||||
addError(d.structDeclaration, MESSAGE.struct_i);
|
addError(d.structDeclaration, MESSAGE.struct_i);
|
||||||
|
@ -224,6 +224,14 @@ public:
|
||||||
void foo(){void foo(){}}
|
void foo(){void foo(){}}
|
||||||
}, sac);
|
}, sac);
|
||||||
|
|
||||||
|
assertAnalyzerWarnings(q{
|
||||||
|
struct S{}
|
||||||
|
}, sac);
|
||||||
|
|
||||||
|
assertAnalyzerWarnings(q{
|
||||||
|
union U{}
|
||||||
|
}, sac);
|
||||||
|
|
||||||
assertAnalyzerWarnings(q{
|
assertAnalyzerWarnings(q{
|
||||||
class Foo{public final void foo(){}}
|
class Foo{public final void foo(){}}
|
||||||
}, sac);
|
}, sac);
|
||||||
|
|
Loading…
Reference in New Issue