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++] Fix the compiler errors reported by GCC 7 #3885

Merged
merged 2 commits into from
Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions runtime/Cpp/runtime/src/FlatHashMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ namespace antlr4 {
using FlatHashMap = absl::flat_hash_map<Key, Value, Hash, Equal, Allocator>;
#else
template <typename Key, typename Value,
typename Hash = typename std::unordered_map<Key, Value>::hasher,
typename Equal = typename std::unordered_map<Key, Value>::key_equal,
typename Allocator = typename std::unordered_map<Key, Value>::allocator_type>
typename Hash = std::hash<Key>,
typename Equal = std::equal_to<Key>,
typename Allocator = std::allocator<std::pair<const Key, Value>>>
using FlatHashMap = std::unordered_map<Key, Value, Hash, Equal, Allocator>;
#endif

Expand Down
6 changes: 3 additions & 3 deletions runtime/Cpp/runtime/src/FlatHashSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ namespace antlr4 {
using FlatHashSet = absl::flat_hash_set<Key, Hash, Equal, Allocator>;
#else
template <typename Key,
typename Hash = typename std::unordered_set<Key>::hasher,
typename Equal = typename std::unordered_set<Key>::key_equal,
typename Allocator = typename std::unordered_set<Key>::allocator_type>
typename Hash = std::hash<Key>,
typename Equal = std::equal_to<Key>,
typename Allocator = std::allocator<Key>>
using FlatHashSet = std::unordered_set<Key, Hash, Equal, Allocator>;
#endif

Expand Down