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

cmake -DCMAKE_CXX_STANDARD=20 failure #319

Open
jingliangliang1 opened this issue Nov 14, 2024 · 5 comments
Open

cmake -DCMAKE_CXX_STANDARD=20 failure #319

jingliangliang1 opened this issue Nov 14, 2024 · 5 comments

Comments

@jingliangliang1
Copy link

When i modify the .github/workflow cmake.yml, set -DCMAKE_CXX_STANDARD=20, in order to test systemc-3.0.0 and cci cmake with c++ standard 20.
Finally, it is failure when step configure cci.

Question: cci is not supported c++ standard 20?

@aut0
Copy link
Collaborator

aut0 commented Nov 14, 2024

Could you please post how to reproduce your issue, i.e. what commands did you enter, what was the output ...

@jingliangliang1
Copy link
Author

jingliangliang1 commented Nov 14, 2024

I fork cci repo, then modify the .github/workflow/cmake.yml.
https://github.com/jingliangliang1/cci/actions/runs/11829314361/workflow , the url is i modified as requested and removed what i did not need. it is failure with c++ stantard 20, systemc 3.0.0.

https://github.com/jingliangliang1/cci/actions/runs/11829327254/workflow, this is success with c++ stantard 17 , systemc 3.0.0 .

@jingliangliang1
Copy link
Author

In file included from /usr/include/c++/12/bits/stl_iterator_base_types.h:71,
from /usr/include/c++/12/bits/stl_algobase.h:65,
from /usr/include/c++/12/vector:60,
from /home/runner/work/cci/cci/systemc/3.0.0/include/sysc/kernel/sc_cmnhdr.h:134,
from /home/runner/work/cci/cci/systemc/3.0.0/include/systemc:70,
from /home/runner/work/cci/cci/src/cci/core/systemc.h:50,
from /home/runner/work/cci/cci/src/cci/core/cci_cmnhdr.h:32,
from /home/runner/work/cci/cci/src/cci/core/cci_value.cpp:30:
/usr/include/c++/12/bits/iterator_concepts.h: In substitution of ‘template using __iter_value_t = typename std::__detail::__iter_traits_impl<_Tp, std::indirectly_readable_traits<_Iter> >::type::value_type [with _Tp = cci::cci_value_iteratorcci::cci_value_map_elem_cref]’:
/usr/include/c++/12/bits/iterator_concepts.h:303:11: required by substitution of ‘template using iter_value_t = std::__detail::__iter_value_t<typename std::remove_cvref<_Tp>::type> [with _Tp = cci::cci_value_iteratorcci::cci_value_map_elem_cref]’
/usr/include/c++/12/bits/stl_iterator.h:169:13: required from ‘class std::reverse_iterator<cci::cci_value_iteratorcci::cci_value_map_elem_cref >’
/home/runner/work/cci/cci/src/cci/core/cci_value.h:896:5: required from here
/usr/include/c++/12/bits/iterator_concepts.h:298:13: error: no type named ‘value_type’ in ‘std::__detail::__iter_traits<cci::cci_value_iteratorcci::cci_value_map_elem_cref, std::indirectly_readable_traits<cci::cci_value_iteratorcci::cci_value_map_elem_cref > >’ {aka ‘struct std::indirectly_readable_traits<cci::cci_value_iteratorcci::cci_value_map_elem_cref >’}
298 | using __iter_value_t = typename
| ^~~~~~~~~~~~~~
/usr/include/c++/12/bits/iterator_concepts.h: In substitution of ‘template using __iter_value_t = typename std::__detail::__iter_traits_impl<_Tp, std::indirectly_readable_traits<_Iter> >::type::value_type [with _Tp = cci::cci_value_iteratorcci::cci_value_map_elem_ref]’:
/usr/include/c++/12/bits/iterator_concepts.h:303:11: required by substitution of ‘template using iter_value_t = std::__detail::__iter_value_t<typename std::remove_cvref<_Tp>::type> [with _Tp = cci::cci_value_iteratorcci::cci_value_map_elem_ref]’
/usr/include/c++/12/bits/stl_iterator.h:169:13: required from ‘class std::reverse_iterator<cci::cci_value_iteratorcci::cci_value_map_elem_ref >’
/home/runner/work/cci/cci/src/cci/core/cci_value.h:1011:5: required from here
/usr/include/c++/12/bits/iterator_concepts.h:298:13: error: no type named ‘value_type’ in ‘std::__detail::__iter_traits<cci::cci_value_iteratorcci::cci_value_map_elem_ref, std::indirectly_readable_traits<cci::cci_value_iteratorcci::cci_value_map_elem_ref > >’ {aka ‘struct std::indirectly_readable_traits<cci::cci_value_iteratorcci::cci_value_map_elem_ref >’}
gmake[2]: *** [src/CMakeFiles/cci.dir/build.make:76: src/CMakeFiles/cci.dir/cci/core/cci_value_converter.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [src/CMakeFiles/cci.dir/build.make:118: src/CMakeFiles/cci.dir/cci/utils/consuming_broker.cpp.o] Error 1
gmake[2]: *** [src/CMakeFiles/cci.dir/build.make:104: src/CMakeFiles/cci.dir/cci/core/cci_value.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:155: src/CMakeFiles/cci.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
Error: Process completed with exit code 2.

@jingliangliang1
Copy link
Author

jingliangliang1 commented Nov 18, 2024

I modifed the file src/cci/core/cci_value.h line no.767 and no.794.

line no.767:
replace "typedef void value_type;" by "using value_type = cci_value_map_elem_cref;"
line no.794:
replace "typedef void value_type;" by "using value_type = cci_value_map_elem_ref;"

details:
e124d71

@jingliangliang1
Copy link
Author

I don't know what the consequences of my changes are, but the current changes do compile successfully using the C++20 standard. Please help me to confirm whether there are any other hidden dangers or not. @aut0 Thanks very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants