Skip to content

Vector.h produces a compiler warning when built with C++14 due to use of "if constexpr" #587

@mrkita

Description

@mrkita

When compiling with gcc on eastl 3.27.00, I run into a warning when "include/vector.h" is included in any compilation unit.

The warning states:
eastl/include/EASTL/vector.h: In function 'void eastl::internal::AssertValueFitsInType(IntSourceType, const char*)':
eastl/include/EASTL/vector.h:104:28: warning: 'if constexpr' only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]

Given that the eastl vector is part of the code base not guarded with compiler traits, I would expect this code to compile without warning.

This warning disappears if "if constexpr" is replaced with the already existing compiler trait macro "EA_CONSTEXPR_IF".

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