compilation of initial example **produces some errors** on Godbolt.org during compilation
Open
F-Haferkorn
opened this issue 10 months ago
•
2 comments
Describe the bug:
clicking on your link “here” In https://github.com/johnmcfarlane/cnl/blob/main/README.md
“You can try out CNL on Compiler Explorer here.”
Does compilation produces some errors on Godbolt.org during compilation
I tried to get an overview of the cnl-project*
*clicking on the link “here” In
“You can try out CNL on Compiler Explorer here.”
following the Readme.md
Godbolt produced lots of compilerr errors
To Reproduce:
see below an excerpt the error mesages of https://godbolt.org/z/vzdvYzeqW
Try to compile the project
https://github.com/johnmcfarlane/cnl/blob/main/README.md
here
Expected behaviour:
expected: godbolt example compiles successfully
**Desktop **
OS: N/A Godbolt.org internal
Compiler: 86_64 gcc 11.1
Compiler flags used: -std=c++20
CMake version N./A.
Conan version N./A.
CNL version (or Git branch/SHA) main
Link to Compiler Explorer:
An example of the failure using Compiler Explorer
Compiler Explorer.
Additional context:
The complete set of error messages.....
: In function 'int main()':
:20:25: error: 'numeric_limits' is not a member of 'cnl'; did you mean 'std::numeric_limits'?
20 | auto epsilon = cnl::numeric_limits::min(); // 1/256
| ^~~~~~~~~~~~~~
In file included from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/used_digits.h:12,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/num_traits/digits.h:15,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/bit.h:13,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:228,
from :1:
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/limits:312:12: note: 'std::numeric_limits' declared here
312 | struct numeric_limits : public __numeric_limits_base
| ^~~~~~~~~~~~~~
:20:44: error: expected primary-expression before '>' token
20 | auto epsilon = cnl::numeric_limits::min(); // 1/256
| ^
:20:47: error: '::min' has not been declared
20 | auto epsilon = cnl::numeric_limits::min(); // 1/256
| ^~~
:20:47: note: suggested alternatives:
In file included from /opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/algorithm:62,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:20,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/constant.h:17,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:230,
from :1:
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/bits/stl_algo.h:3455:5: note: 'std::min'
3455 | min(initializer_list<_tp> __l, _Compare __comp)
| ^~~
In file included from /opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/algorithm:64,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:20,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/constant.h:17,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:230,
from :1:
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/bits/ranges_algo.h:3164:29: note: 'std::ranges::min'
3164 | inline constexpr __min_fn min{};
| ^~~
In file included from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:233,
from :1:
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h: In instantiation of 'constexpr auto cnl::literals::operator""_cnl2() [with char ...Chars = {'1', '6', '3', '8', '4', '.', '0', '0', '0', '0', '1', '5', '2', '5', '8', '7', '8', '9', '0', '6', '2', '5'}]':
:28:14: required from here
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:170:72: in 'constexpr' expansion of 'cnl::_impl::parse_real()'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:335:38: in 'constexpr' expansion of 'cnl::_impl::parse_string()'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:300:58: in 'constexpr' expansion of 'cnl::_impl::parse_string(const char [22]{'1', '6', '3', '8', '4', '.', '0', '0', '0', '0', '1', '5', '2', '5', '8', '7', '8', '9', '0', '6', '2', '5'}, 21, 0, 10, 18, 0)'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:294:40: in 'constexpr' expansion of 'cnl::_impl::parse_string((((const char*)str) + ((sizetype)first_numeral)), num_digits, ((int)is_negative), base, stride)'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:283:38: in 'constexpr' expansion of '((long int (*)(const long int&))chunk_scale_op)((*(const long int*)(& std::move(init))))'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:336:50: in 'constexpr' expansion of '0->cnl::_impl::make_scale_op_chunk(int)::()'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:170:28: error: overflow in constant expression [-fpermissive]
170 | constexpr auto parsed{_impl::parse_real()};
| ^~~~~~
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:171:94: error: no matching function for call to 'make_from_udl<:_impl::descaled int>::significand, parsed.cnl::_impl::descaled::exponent, cnl::_impl::descaled::radix, 2>()'
171 | return _impl::make_from_udl();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:116:38: note: candidate: 'template, >] ParsedSignificand, auto [requires cnl::integer, >] ParsedExponent, int ParsedRadix, int UdlRadix> constexpr auto cnl::_impl::make_from_udl()'
116 | [[nodiscard]] constexpr auto make_from_udl()
| ^~~~~~~~~~~~~
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:116:38: note: template argument deduction/substitution failed:
:29:24: error: template argument 1 is invalid
29 | static_assert(std::is_same_v>>);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:32:24: error: template argument 1 is invalid
32 | static_assert(std::is_same_v>>);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ASM generation compiler returned: 1
: In function 'int main()':
:20:25: error: 'numeric_limits' is not a member of 'cnl'; did you mean 'std::numeric_limits'?
20 | auto epsilon = cnl::numeric_limits::min(); // 1/256
| ^~~~~~~~~~~~~~
In file included from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/used_digits.h:12,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/num_traits/digits.h:15,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/bit.h:13,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:228,
from :1:
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/limits:312:12: note: 'std::numeric_limits' declared here
312 | struct numeric_limits : public __numeric_limits_base
| ^~~~~~~~~~~~~~
:20:44: error: expected primary-expression before '>' token
20 | auto epsilon = cnl::numeric_limits::min(); // 1/256
| ^
:20:47: error: '::min' has not been declared
20 | auto epsilon = cnl::numeric_limits::min(); // 1/256
| ^~~
:20:47: note: suggested alternatives:
In file included from /opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/algorithm:62,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:20,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/constant.h:17,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:230,
from :1:
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/bits/stl_algo.h:3455:5: note: 'std::min'
3455 | min(initializer_list<_tp> __l, _Compare __comp)
| ^~~
In file included from /opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/algorithm:64,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:20,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/constant.h:17,
from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:230,
from :1:
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/bits/ranges_algo.h:3164:29: note: 'std::ranges::min'
3164 | inline constexpr __min_fn min{};
| ^~~
In file included from /opt/compiler-explorer/libs/cnl/trunk/include/cnl/all.h:233,
from :1:
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h: In instantiation of 'constexpr auto cnl::literals::operator""_cnl2() [with char ...Chars = {'1', '6', '3', '8', '4', '.', '0', '0', '0', '0', '1', '5', '2', '5', '8', '7', '8', '9', '0', '6', '2', '5'}]':
:28:14: required from here
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:170:72: in 'constexpr' expansion of 'cnl::_impl::parse_real()'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:335:38: in 'constexpr' expansion of 'cnl::_impl::parse_string()'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:300:58: in 'constexpr' expansion of 'cnl::_impl::parse_string(const char [22]{'1', '6', '3', '8', '4', '.', '0', '0', '0', '0', '1', '5', '2', '5', '8', '7', '8', '9', '0', '6', '2', '5'}, 21, 0, 10, 18, 0)'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:294:40: in 'constexpr' expansion of 'cnl::_impl::parse_string((((const char*)str) + ((sizetype)first_numeral)), num_digits, ((int)is_negative), base, stride)'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:283:38: in 'constexpr' expansion of '((long int (*)(const long int&))chunk_scale_op)((*(const long int*)(& std::move(init))))'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/_impl/parse.h:336:50: in 'constexpr' expansion of '0->cnl::_impl::make_scale_op_chunk(int)::()'
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:170:28: error: overflow in constant expression [-fpermissive]
170 | constexpr auto parsed{_impl::parse_real()};
| ^~~~~~
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:171:94: error: no matching function for call to 'make_from_udl<:_impl::descaled int>::significand, parsed.cnl::_impl::descaled::exponent, cnl::_impl::descaled::radix, 2>()'
171 | return _impl::make_from_udl();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:116:38: note: candidate: 'template, >] ParsedSignificand, auto [requires cnl::integer, >] ParsedExponent, int ParsedRadix, int UdlRadix> constexpr auto cnl::_impl::make_from_udl()'
116 | [[nodiscard]] constexpr auto make_from_udl()
| ^~~~~~~~~~~~~
/opt/compiler-explorer/libs/cnl/trunk/include/cnl/elastic_scaled_integer.h:116:38: note: template argument deduction/substitution failed:
:29:24: error: template argument 1 is invalid
29 | static_assert(std::is_same_v>>);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:32:24: error: template argument 1 is invalid
32 | static_assert(std::is_same_v>>);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Execution build compiler returned: 1