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

[C++] Switch to std::any and deprecate antlrcpp::Any #3395

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

jcking
Copy link
Collaborator

@jcking jcking commented Dec 6, 2021

Remove antlrcpp::Any in favor of std::any. Unfortunately there is no good story for backwards compatibility as std::any is a smaller feature set and only supports static_cast.

@jcking
Copy link
Collaborator Author

jcking commented Dec 6, 2021

@mike-lischke I kept antlrcpp::Any as a type alias to std::any to at least make the error people will get more clear and require less changes overall. We can remove antlrcpp::Any at some point in the future.

@jcking jcking force-pushed the cpp-any branch 2 times, most recently from 767bba0 to 557620d Compare December 6, 2021 21:39
Copy link
Member

@mike-lischke mike-lischke left a comment

Choose a reason for hiding this comment

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

The patch looks good, however in the build output I see 3 warnings, that should be fixed. No idea when this creeped in, but I see now:

/tmp/BaseCppTest-main-1638301471082/TParser.cpp:79:29: warning: explicit capture of 'this' with a capture default of '=' is a C++20 extension [-Wc++20-extensions]
auto onExit = finally([=, this] {

Then we get a number of warnings because of the recently deprecated EMPTY_VOCABULARY.

And finally a (probably old) problem with an implicit switch fall through. See the C++ build output in CircleCI.

Can you fix those too?

@KvanTTT
Copy link
Member

KvanTTT commented Dec 7, 2021

/tmp/BaseCppTest-main-1638301471082/TParser.cpp:79:29: warning: explicit capture of 'this' with a capture default of '=' is a C++20 extension [-Wc++20-extensions]

It looks like has been fixed recently: #3393

@jcking
Copy link
Collaborator Author

jcking commented Dec 7, 2021

Fixed everything except EMPTY_VOCABULARY. I'll fix that in a standalone CL. The C++20 warning was fixed in a separate CL after I noticed it. I had misread a preprocessor condition as checking for C++ 17 when it was checking for C++ 20.

@mike-lischke
Copy link
Member

@parrt Another C++ patch to merge. There are some build errors, but from what I see they are all caused by configuration problems on CircleCI.

@parrt
Copy link
Member

parrt commented Dec 7, 2021

Ok, yeah, I think I broke everything yesterday outside of Circleci

@parrt parrt added this to the 4.9.4 milestone Dec 7, 2021
@parrt parrt merged commit 3cf70fc into antlr:master Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants