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

Add C++ test for deprecated Slice metadata #3038

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

bernardnormier
Copy link
Member

This PR adds a new C++ test (Slice/deprecated) and fixes a few bugs uncovered by this test.

@@ -71,21 +71,21 @@ namespace
}
}

string getDeprecatedSymbol(const ContainedPtr& p1)
string getDeprecatedAttribute(const ContainedPtr& p1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to match the C++ terminology.

}
else
{
deprecatedSymbol = "[[deprecated]] ";
deprecatedAttribute = "[[deprecated]] ";
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 actually never reach this line. See #3039.

@@ -1338,21 +1338,24 @@ Slice::Gen::ForwardDeclVisitor::visitSequence(const SequencePtr& p)
string seqType = findMetadata(metadata, _useWstring);
writeDocSummary(H, p);

string deprecatedAttribute = getDeprecatedAttribute(p);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sequences and dictionaries didn't get [[deprecated]] prior to this PR.

<< sp;
}

bool
Slice::Gen::ForwardDeclVisitor::visitStructStart(const StructPtr& p)
{
H << nl << "struct " << fixKwd(p->name()) << ';' << sp;
H << nl << "struct " << getDeprecatedAttribute(p) << fixKwd(p->name()) << ';' << sp;
Copy link
Member Author

@bernardnormier bernardnormier Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for consistency. Doesn't matter since the C++ struct definition is always in the same file.

Copy link
Member

@InsertCreativityHere InsertCreativityHere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@bernardnormier bernardnormier merged commit 78299bf into zeroc-ice:main Nov 4, 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