Skip to content

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

Open
@ZERICO2005

Description

@ZERICO2005
/* 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions