Skip to content

Commit

Permalink
Fix lints in generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Dec 11, 2024
1 parent 020616e commit b31ded3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpp/src/slice2cpp/CPlusPlusUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ Slice::writeIceTuple(::IceInternal::Output& out, const DataMemberList& dataMembe
{
// Use an empty scope to get full qualified names from calls to typeToString.
const string scope = "";
out << nl << "std::tuple<";
out << nl << "[[nodiscard]] std::tuple<";
for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
if (q != dataMembers.begin())
Expand Down
12 changes: 10 additions & 2 deletions cpp/src/slice2cpp/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ Slice::Gen::generate(const UnitPtr& p)
s = _include + '/' + s;
}
transform(s.begin(), s.end(), s.begin(), ToIfdef());
H << "\n#ifndef __" << s << "__";
H << "\n#define __" << s << "__";
H << "\n#ifndef " << s << "_";
H << "\n#define " << s << "_";
H << '\n';

validateMetadata(p);
Expand Down Expand Up @@ -1393,13 +1393,21 @@ Slice::Gen::ProxyVisitor::visitInterfaceDefEnd(const InterfaceDefPtr& p)
H << sp;
H << nl << prx << "& operator=(const " << prx << "& rhs) noexcept";
H << sb;
// The self-assignment check is to make clang-tidy happy.
H << nl << "if (this != &rhs)";
H << sb;
H << nl << "::Ice::ObjectPrx::operator=(rhs);";
H << eb;
H << nl << "return *this;";
H << eb;
H << sp;
H << nl << prx << "& operator=(" << prx << "&& rhs) noexcept";
H << sb;
// The self-assignment check is to make clang-tidy happy.
H << nl << "if (this != &rhs)";
H << sb;
H << nl << "::Ice::ObjectPrx::operator=(::std::move(rhs));";
H << eb;
H << nl << "return *this;";
H << eb;
H << sp;
Expand Down

0 comments on commit b31ded3

Please sign in to comment.