Skip to content

utility and type_traits don't work in C++11 #534

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

Open
ZERICO2005 opened this issue Feb 2, 2025 · 0 comments
Open

utility and type_traits don't work in C++11 #534

ZERICO2005 opened this issue Feb 2, 2025 · 0 comments

Comments

@ZERICO2005
Copy link
Contributor

ZERICO2005 commented Feb 2, 2025

/* every header in libc/include */

/* every header in libcxx/include (excluding C++20 <concepts>) */

int main(void) {
	return 0;
}

This compiles fine in c++2b c++20 c++17 c++14 and gnu++2b gnu++20 gnu++17 gnu++14, but I get errors from <type_traits> and <utility> when compiling under C++11 CXXFLAGS = -Wall -Wextra -Wshadow -O0 -std=c++11 (gnu++11 gave the same errors)

/* std::move */
toolchain/CEdev/include/c++/type_traits:304:45: error: 'auto' return without
      trailing return type; deduced return types are a C++14 extension
template<class _Tp> _EZCXX_INLINE constexpr auto move(_Tp&& __value) noexcept {
                                            ^
/* std::swap */
toolchain/CEdev/include/c++/type_traits:309:1: error: no return statement in
      constexpr function
swap(_Tp& __lhs, _Tp& __rhs) noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>) {
^
/* std::as_const */
toolchain/CEdev/include/c++/utility:32:45: error: 'auto' return without trailing
      return type; deduced return types are a C++14 extension
template<class _Tp> _EZCXX_INLINE constexpr auto as_const(_Tp const&& __value) noexcept = delete;
                                            ^

Going off cppreference, some of these functions may have incorrect prototypes. Commenting out the functions allows the code to compile okay in C++11 otherwise.

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

No branches or pull requests

1 participant