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)
|
||||
{
|
||||
_finalAggregate = isFinal;
|
||||
if (savedParent == Parent.module_)
|
||||
if (_finalAggregate && savedParent == Parent.module_)
|
||||
{
|
||||
if (d.structDeclaration)
|
||||
addError(d.structDeclaration, MESSAGE.struct_i);
|
||||
|
@ -224,6 +224,14 @@ public:
|
|||
void foo(){void foo(){}}
|
||||
}, sac);
|
||||
|
||||
assertAnalyzerWarnings(q{
|
||||
struct S{}
|
||||
}, sac);
|
||||
|
||||
assertAnalyzerWarnings(q{
|
||||
union U{}
|
||||
}, sac);
|
||||
|
||||
assertAnalyzerWarnings(q{
|
||||
class Foo{public final void foo(){}}
|
||||
}, sac);
|
||||
|
|
Loading…
Reference in New Issue