Qt-Generic-NoMixOfClassStructΒΆ
Consistently use either the keyword class or struct per composite type, do not mix them
Required inputs: IR
class, while others for the same type use the keyword
struct.
Bad code:
// foo.hpp
class Foo {
// ...
};
// bar.hpp
struct Foo; // ERROR: Mixed use of class and struct keywords for the same type.
void bar(Foo *);
Good code:
// foo.hpp
class Foo {
// ...
};
// bar.hpp
class Foo; // OK: Consistent use of class keyword for the same type.
void bar(Foo *);
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
mixed_class_struct_keywords |
Mixed use of class and struct keyword for the same type. |
None |
False |
Options
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
This rule has no individual options.