-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lints in generated C++ code #3262
Conversation
UseColor: true | ||
FormatStyle: 'file' | ||
ExtraArgs: ['-std=c++17'] | ||
ExtraArgs: ['-std=c++20'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use C++20 types (std::span) for a test in C++20 mode; clang-tidy doesn't like -std=c++17 for that test.
@@ -1111,9 +1111,14 @@ Slice::Gen::ForwardDeclVisitor::visitEnum(const EnumPtr& p) | |||
H << "class "; | |||
} | |||
H << getDeprecatedAttribute(p) << fixKwd(p->name()); | |||
if (!unscoped && p->maxValue() <= 0xFF) | |||
if (!unscoped) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we have no test for unscoped: we should either test it or remove it.
@@ -1543,6 +1553,10 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) | |||
} | |||
H << nl << deprecatedAttribute << retS << ' ' << fixKwd(name) << spar << paramsDecl << contextDecl << epar | |||
<< " const;"; | |||
if (ret) | |||
{ | |||
H << " // NOLINT:modernize-use-nodiscard"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't generate a [[nodiscard]] for sync proxy functions returning something.
This PR fix lints in the generated C++, primarily in generated C++ header files.