Skip to content

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

Merged
parrt merged 1 commit into
antlr:masterfrom
jcking:cpp-any
Dec 7, 2021
Merged

parrt merged 1 commit into
antlr:masterfrom
jcking:cpp-any

Conversation

@jcking

@jcking jcking commented Dec 6, 2021

Copy link
Copy Markdown
Collaborator

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

jcking commented Dec 6, 2021

Copy link
Copy Markdown
Collaborator Author

@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

@mike-lischke mike-lischke left a comment

Copy link
Copy Markdown
Member

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

KvanTTT commented Dec 7, 2021 •

Copy link
Copy Markdown
Member

/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

jcking commented Dec 7, 2021

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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

parrt commented Dec 7, 2021

Copy link
Copy Markdown
Member

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.

4 participants