You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A range object that return different types for begin() and end() fails to check if the types is printable.
Expected behavior
printValue_impl<CollectionType> must not fail whether CollectionType is printable or not.
To Reproduce
I'm using C++14 library that provide vccc::views::iota that models std::views::iota.
The standard defines that It returns different type for sentinel if it models unbounded iota_view.
Anyway, detailed description is not really necessary because the fix is really simple and intuitive.
Input line
vccc::views::iota(10) | vccc::views::take(4)
Output
In file included from input_line_11:1:
In file included from /Users/yonggyulee/Documents/GitHub/lackhole/xeus-cling/install/include/xcpp/xmime.hpp:16:
/usr/local/include/cling/Interpreter/RuntimePrintValue.h:224:7: error: 'auto' deduced as 'counted_iterator<I>' (aka 'counted_iterator<vccc::ranges::iota_view<int, vccc::unreachable_sentinel_t>::iterator>') in declaration of 'iter'and deduced as 'sentinel<true>' in declaration of 'iterEnd'auto iter = obj->begin(), iterEnd = obj->end();
^ ~~~~~~~~~~~~ ~~~~~~~~~~
/usr/local/include/cling/Interpreter/RuntimePrintValue.h:241:39: note: in instantiation of function template specialization 'cling::collectionPrinterInternal::printValue_impl<vccc::ranges::take_view<vccc::ranges::iota_view<int>>>' requested here
return collectionPrinterInternal::printValue_impl(obj);
^
/Users/yonggyulee/Documents/GitHub/lackhole/xeus-cling/install/include/xcpp/xmime.hpp:49:39: note: in instantiation of function template specialization 'cling::printValue<vccc::ranges::take_view<vccc::ranges::iota_view<int>>>' requested here
bundle["text/plain"] = cling::printValue(&value);
^
input_line_24:2:2: note: in instantiation of function template specialization 'xcpp::mime_bundle_repr<vccc::ranges::take_view<vccc::ranges::iota_view<int>>>' requested here
mime_bundle_repr(*(*(vccc::ranges::take_view<vccc::ranges::iota_view<int, vccc::unreachable_sentinel_t>>**)0x7ff7b1808090));
Describe the bug
A range object that return different types for
begin()
andend()
fails to check if the types is printable.Expected behavior
printValue_impl<CollectionType>
must not fail whetherCollectionType
is printable or not.To Reproduce
I'm using C++14 library that provide
vccc::views::iota
that modelsstd::views::iota
.The standard defines that It returns different type for sentinel if it models unbounded
iota_view
.Anyway, detailed description is not really necessary because the fix is really simple and intuitive.
Input line
Output
Setup
master
macOS 14.0
Fix
Just Change the following lines
https://github.com/root-project/cling/blob/master/include/cling/Interpreter/RuntimePrintValue.h#L203
https://github.com/root-project/cling/blob/master/include/cling/Interpreter/RuntimePrintValue.h#L224
To
Created a PR #516
After fix
The text was updated successfully, but these errors were encountered: