test gcc9
This commit is contained in:
parent
94337cdfc8
commit
1e09aef7fd
3 changed files with 17 additions and 4 deletions
11
.travis.yml
11
.travis.yml
|
@ -31,6 +31,17 @@ matrix:
|
||||||
env:
|
env:
|
||||||
- CXX_COMPILER=g++-8 CC_COMPILER=gcc-8
|
- CXX_COMPILER=g++-8 CC_COMPILER=gcc-8
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-9
|
||||||
|
env:
|
||||||
|
- CXX_COMPILER=g++-9 CC_COMPILER=gcc-9
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++
|
compiler: clang++
|
||||||
addons:
|
addons:
|
||||||
|
|
|
@ -168,8 +168,10 @@ template <typename E, E V>
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
std::string_view name{__PRETTY_FUNCTION__};
|
std::string_view name{__PRETTY_FUNCTION__};
|
||||||
constexpr auto prefix = sizeof("constexpr std::string_view nameof::detail::nameof_enum_impl() [with E = ") + nameof_type_impl<identity<E>>().length() + sizeof("; V = ");
|
constexpr auto prefix = sizeof("constexpr std::string_view nameof::detail::nameof_enum_impl() [with E = ") + nameof_type_impl<identity<E>>().length() + sizeof("; V = ");
|
||||||
|
# if __GNUC__ < 9
|
||||||
constexpr auto suffix = sizeof("; std::string_view = std::basic_string_view<char>]") - 1;
|
constexpr auto suffix = sizeof("; std::string_view = std::basic_string_view<char>]") - 1;
|
||||||
name.remove_prefix(prefix);
|
name.remove_prefix(prefix);
|
||||||
|
# endif
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
std::string_view name{__FUNCSIG__};
|
std::string_view name{__FUNCSIG__};
|
||||||
constexpr auto suffix = sizeof(">(void) noexcept") - 1;
|
constexpr auto suffix = sizeof(">(void) noexcept") - 1;
|
||||||
|
@ -179,7 +181,7 @@ template <typename E, E V>
|
||||||
|
|
||||||
#if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER)
|
#if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER)
|
||||||
name.remove_suffix(suffix);
|
name.remove_suffix(suffix);
|
||||||
# if defined(__clang__) || defined(_MSC_VER)
|
# if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9) || defined(_MSC_VER)
|
||||||
for (std::size_t i = name.size(); i > 0; --i) {
|
for (std::size_t i = name.size(); i > 0; --i) {
|
||||||
if (!is_name_char(name[i - 1])) {
|
if (!is_name_char(name[i - 1])) {
|
||||||
name.remove_prefix(i);
|
name.remove_prefix(i);
|
||||||
|
|
|
@ -212,7 +212,7 @@ TEST_CASE("NAMEOF_RAW") {
|
||||||
TEST_CASE("NAMEOF_ENUM") {
|
TEST_CASE("NAMEOF_ENUM") {
|
||||||
Color color_ = Color::BLUE;
|
Color color_ = Color::BLUE;
|
||||||
Color m[3] = {Color::RED, Color::GREEN, Color::BLUE};
|
Color m[3] = {Color::RED, Color::GREEN, Color::BLUE};
|
||||||
#if defined(__clang__) || defined(_MSC_VER)
|
#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9) || defined(_MSC_VER)
|
||||||
REQUIRE(NAMEOF_ENUM(Color::RED) == "RED");
|
REQUIRE(NAMEOF_ENUM(Color::RED) == "RED");
|
||||||
REQUIRE(NAMEOF_ENUM(color) == "RED");
|
REQUIRE(NAMEOF_ENUM(color) == "RED");
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ TEST_CASE("NAMEOF_ENUM") {
|
||||||
TEST_CASE("nameof::nameof_enum<T>(value)") {
|
TEST_CASE("nameof::nameof_enum<T>(value)") {
|
||||||
Color color_ = Color::BLUE;
|
Color color_ = Color::BLUE;
|
||||||
Color m[3] = {Color::RED, Color::GREEN, Color::BLUE};
|
Color m[3] = {Color::RED, Color::GREEN, Color::BLUE};
|
||||||
#if defined(__clang__) || defined(_MSC_VER)
|
#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9) || defined(_MSC_VER)
|
||||||
REQUIRE(nameof::nameof_enum(Color::RED) == "RED");
|
REQUIRE(nameof::nameof_enum(Color::RED) == "RED");
|
||||||
REQUIRE(nameof::nameof_enum(color) == "RED");
|
REQUIRE(nameof::nameof_enum(color) == "RED");
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ TEST_CASE("nameof::nameof_enum<T>(value)") {
|
||||||
TEST_CASE("nameof::nameof_enum<value>()") {
|
TEST_CASE("nameof::nameof_enum<value>()") {
|
||||||
constexpr Color color_ = Color::BLUE;
|
constexpr Color color_ = Color::BLUE;
|
||||||
constexpr Color m[3] = {Color::RED, Color::GREEN, Color::BLUE};
|
constexpr Color m[3] = {Color::RED, Color::GREEN, Color::BLUE};
|
||||||
#if defined(__clang__) || defined(_MSC_VER)
|
#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9) || defined(_MSC_VER)
|
||||||
REQUIRE(nameof::nameof_enum<Color::RED>() == "RED");
|
REQUIRE(nameof::nameof_enum<Color::RED>() == "RED");
|
||||||
REQUIRE(nameof::nameof_enum<color>() == "RED");
|
REQUIRE(nameof::nameof_enum<color>() == "RED");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue