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

GCC < 8: error: 'get_sso_capacity' was not declared in this scope #55

Closed
maddouri opened this issue Oct 30, 2020 · 3 comments
Closed

GCC < 8: error: 'get_sso_capacity' was not declared in this scope #55

maddouri opened this issue Oct 30, 2020 · 3 comments
Labels

Comments

@maddouri
Copy link

maddouri commented Oct 30, 2020

Hello,

It seems that the code sample shown in the readme can't be compiled with some versions of GCC < 8.

Example at https://godbolt.org/z/vdE453 with GCC 7.4, -std=c++17 and commit 048f74d

tinyutf8.h: In substitution of 'template<class ValueType, class DataType, class Allocator> template<typename std::allocator_traits<_NodeAlloc>::size_type L> using enable_if_small_string = typename std::enable_if<(L <= get_sso_capacity()), bool>::type [with typename std::allocator_traits<_NodeAlloc>::size_type L = LITLEN; ValueType = ValueType; DataType = DataType; Allocator = Allocator]':
tinyutf8.h:1047:140:   required from here
tinyutf8.h:668:81: error: 'get_sso_capacity' was not declared in this scope
tinyutf8.h: In substitution of 'template<class ValueType, class DataType, class Allocator> template<typename std::allocator_traits<_NodeAlloc>::size_type L> using enable_if_not_small_string = typename std::enable_if<(L > get_sso_capacity()), bool>::type [with typename std::allocator_traits<_NodeAlloc>::size_type L = LITLEN; ValueType = ValueType; DataType = DataType; Allocator = Allocator]':
tinyutf8.h:1060:144:   required from here
tinyutf8.h:670:84: error: 'get_sso_capacity' was not declared in this scope

ASM generation compiler returned: 1

tinyutf8.h: In substitution of 'template<class ValueType, class DataType, class Allocator> template<typename std::allocator_traits<_NodeAlloc>::size_type L> using enable_if_small_string = typename std::enable_if<(L <= get_sso_capacity()), bool>::type [with typename std::allocator_traits<_NodeAlloc>::size_type L = LITLEN; ValueType = ValueType; DataType = DataType; Allocator = Allocator]':
tinyutf8.h:1047:140:   required from here
tinyutf8.h:668:81: error: 'get_sso_capacity' was not declared in this scope
tinyutf8.h: In substitution of 'template<class ValueType, class DataType, class Allocator> template<typename std::allocator_traits<_NodeAlloc>::size_type L> using enable_if_not_small_string = typename std::enable_if<(L > get_sso_capacity()), bool>::type [with typename std::allocator_traits<_NodeAlloc>::size_type L = LITLEN; ValueType = ValueType; DataType = DataType; Allocator = Allocator]':
tinyutf8.h:1060:144:   required from here
tinyutf8.h:670:84: error: 'get_sso_capacity' was not declared in this scope

Can you please have a look at this error?

Thanks :)

@DuffsDevice
Copy link
Owner

Hi Yassine,

thank you for your bug report! I will immediately have a look :)

DuffsDevice added a commit that referenced this issue Nov 1, 2020
@DuffsDevice
Copy link
Owner

And thanks for the godbolt example, that made it really easy to know what was going on!

@DuffsDevice DuffsDevice added the bug label Nov 1, 2020
@DuffsDevice
Copy link
Owner

Cheers, Jakob

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

No branches or pull requests

2 participants