Skip to content
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

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

bernardnormier
Copy link
Member

This PR fix lints in the generated C++, primarily in generated C++ header files.

UseColor: true
FormatStyle: 'file'
ExtraArgs: ['-std=c++17']
ExtraArgs: ['-std=c++20']
Copy link
Member Author

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)
Copy link
Member Author

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";
Copy link
Member Author

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.

cpp/src/slice2cpp/Gen.cpp Outdated Show resolved Hide resolved
cpp/src/slice2cpp/Gen.cpp Show resolved Hide resolved
@bernardnormier bernardnormier merged commit 910b174 into zeroc-ice:main Dec 12, 2024
19 checks passed
InsertCreativityHere pushed a commit to InsertCreativityHere/compiler-comparison that referenced this pull request Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants