You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "maskit (via GitHub)" <gi...@apache.org> on 2023/04/06 06:32:38 UTC
[GitHub] [trafficserver] maskit opened a new pull request, #9584: Fix a compile error in C++20
maskit opened a new pull request, #9584:
URL: https://github.com/apache/trafficserver/pull/9584
```
IOBuffer.cc: In function ‘auto make_buffer_size_parser()’:
IOBuffer.cc:99:3: error: call of overloaded ‘Lexicon(<brace-enclosed initializer list>)’ is ambiguous
99 | }](swoc::TextView esize) -> std::optional<int> {
| ^
In file included from IOBuffer.cc:30:
/home/maskit/src/trafficserver/lib/swoc/include/swoc/Lexicon.h:576:1: note: candidate: ‘swoc::_1_4_6::Lexicon<E>::Lexicon(const std::initializer_list<std::tuple<E, std::basic_string_view<char, std::char_traits<char> > > >&, swoc::_1_4_6::Lexicon<E>::DefaultHandler, swoc::_1_4_6::Lexicon<E>::DefaultHandler) [with E = int; swoc::_1_4_6::Lexicon<E>::DefaultHandler = std::variant<std::monostate, int, std::basic_string_view<char, std::char_traits<char> >, std::function<int(std::basic_string_view<char, std::char_traits<char> >)>, std::function<std::basic_string_view<char, std::char_traits<char> >(int)> >]’
576 | Lexicon<E>::Lexicon(const std::initializer_list<Pair> &items, DefaultHandler handler_1, DefaultHandler handler_2) {
| ^~~~~~~~~~
/home/maskit/src/trafficserver/lib/swoc/include/swoc/Lexicon.h:565:1: note: candidate: ‘swoc::_1_4_6::Lexicon<E>::Lexicon(const std::initializer_list<swoc::_1_4_6::Lexicon<E>::Definition>&, swoc::_1_4_6::Lexicon<E>::DefaultHandler, swoc::_1_4_6::Lexicon<E>::DefaultHandler) [with E = int; swoc::_1_4_6::Lexicon<E>::DefaultHandler = std::variant<std::monostate, int, std::basic_string_view<char, std::char_traits<char> >, std::function<int(std::basic_string_view<char, std::char_traits<char> >)>, std::function<std::basic_string_view<char, std::char_traits<char> >(int)> >]’
565 | Lexicon<E>::Lexicon(const std::initializer_list<Definition> &items, DefaultHandler handler_1, DefaultHandler handler_2) {
| ^~~~~~~~~~
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] dragon512 commented on pull request #9584: Fix a compile error in C++20
Posted by "dragon512 (via GitHub)" <gi...@apache.org>.
dragon512 commented on PR #9584:
URL: https://github.com/apache/trafficserver/pull/9584#issuecomment-1540933552
I think this is the wrong fix.
it should be
`index e23d1f8..8678097 100644
--- a/iocore/eventsystem/IOBuffer.cc
+++ b/iocore/eventsystem/IOBuffer.cc
@@ -79,7 +79,7 @@ init_buffer_allocators(int iobuffer_advice)
auto
make_buffer_size_parser()
{
- return [l = swoc::Lexicon<int>{
+ return [l = swoc::Lexicon<int>{swoc::Lexicon<int>::with_multi
{{0, {"128"}},
{1, {"256"}},
{2, {"512"}},`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] maskit closed pull request #9584: Fix a compile error in C++20
Posted by "maskit (via GitHub)" <gi...@apache.org>.
maskit closed pull request #9584: Fix a compile error in C++20
URL: https://github.com/apache/trafficserver/pull/9584
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] brbzull0 commented on a diff in pull request #9584: Fix a compile error in C++20
Posted by "brbzull0 (via GitHub)" <gi...@apache.org>.
brbzull0 commented on code in PR #9584:
URL: https://github.com/apache/trafficserver/pull/9584#discussion_r1160606152
##########
iocore/eventsystem/IOBuffer.cc:
##########
@@ -80,7 +80,7 @@ auto
make_buffer_size_parser()
{
return [l = swoc::Lexicon<int>{
- {{0, {"128"}},
+ {swoc::Lexicon<int>::Definition{0, {"128"}},
Review Comment:
I think this can be handled by `swoc::Lexicon` and not by us here. @SolidWallOfCode ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] maskit commented on pull request #9584: Fix a compile error in C++20
Posted by "maskit (via GitHub)" <gi...@apache.org>.
maskit commented on PR #9584:
URL: https://github.com/apache/trafficserver/pull/9584#issuecomment-1544817703
#9700 will resolve the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] maskit closed pull request #9584: Fix a compile error in C++20
Posted by "maskit (via GitHub)" <gi...@apache.org>.
maskit closed pull request #9584: Fix a compile error in C++20
URL: https://github.com/apache/trafficserver/pull/9584
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] SolidWallOfCode commented on pull request #9584: Fix a compile error in C++20
Posted by "SolidWallOfCode (via GitHub)" <gi...@apache.org>.
SolidWallOfCode commented on PR #9584:
URL: https://github.com/apache/trafficserver/pull/9584#issuecomment-1502087395
I've been investigating this and I think the problem is the `string_view` constructor that takes iterators, which is new in C++20. This makes something like `{ value, { "name1", "name2"}}` convertible to `Pair{value, string_view{"name1", "name2")}` which wasn't previously the case. I am pondering a couple of different approaches.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] SolidWallOfCode commented on a diff in pull request #9584: Fix a compile error in C++20
Posted by "SolidWallOfCode (via GitHub)" <gi...@apache.org>.
SolidWallOfCode commented on code in PR #9584:
URL: https://github.com/apache/trafficserver/pull/9584#discussion_r1161174142
##########
iocore/eventsystem/IOBuffer.cc:
##########
@@ -80,7 +80,7 @@ auto
make_buffer_size_parser()
{
return [l = swoc::Lexicon<int>{
- {{0, {"128"}},
+ {swoc::Lexicon<int>::Definition{0, {"128"}},
Review Comment:
Talk to @cmcfarlen - it's a bit of an odd use.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] maskit commented on pull request #9584: Fix a compile error in C++20
Posted by "maskit (via GitHub)" <gi...@apache.org>.
maskit commented on PR #9584:
URL: https://github.com/apache/trafficserver/pull/9584#issuecomment-1498565319
Works for C++20 but not C++17
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org