Skip to content

Compiling errors under Clang #2096

@byRandom

Description

@byRandom

Hey, trying to compile in Ubuntu 25.10 gave me some easy to solve errors that were in cereal library:


   98 |         serialize<Height - 1>::template apply( ar, tuple );

      |                                         ^

./extern/cereal/types/tuple.hpp:119:85: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]

  119 |     tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply( ar, tuple );

      |                                                                                     ^

In file included from view_object.cpp:18:

In file included from ./view_object.h:20:

./util.h:700:25: warning: identifier '_s' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]

  700 | std::string operator "" _s(const char* str, size_t);

      |             ~~~~~~~~~~~~^~

      |             operator""_s

In file included from view_object.cpp:18:

In file included from ./view_object.h:24:

./game_time.h:38:26: warning: identifier '_visible' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]

   38 | TimeInterval operator "" _visible(unsigned long long value);

      |              ~~~~~~~~~~~~^~~~~~~~

      |              operator""_visible

./game_time.h:80:24: warning: identifier '_global' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]

   80 | GlobalTime operator "" _global(unsigned long long value);

      |            ~~~~~~~~~~~~^~~~~~~

      |            operator""_global

./game_time.h:81:23: warning: identifier '_local' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]

   81 | LocalTime operator "" _local(unsigned long long value);

      |           ~~~~~~~~~~~~^~~~~~

      |           operator""_local

In file included from view_object.cpp:249:

./pretty_archive.h:463:41: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]

  463 |         serialize<Height - 1>::template apply(ar1, tuple);

      |                                         ^

./pretty_archive.h:477:90: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]

  477 |   pretty_tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply( ar, tuple );

      |                                                                                          ^

4 warnings and 4 errors generated.

make[1]: *** [Makefile:143: obj-opt/view_object.o] Error 1

make: *** [Makefile:130: all] Error 2

Managed to fix them doing the next changes:

File: extern/cereal/types/tuple.hpp

Line 98:

// 🔴 BAD (Current)
serialize<Height - 1>::template apply( ar, tuple );

// 🟢 GOOD (Remove 'template')
serialize<Height - 1>::apply( ar, tuple );

Line 119:

// 🔴 BAD (Current)
tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply( ar, tuple );

// 🟢 GOOD (Remove 'template')
tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::apply( ar, tuple );

File: pretty_archive.h

Line 463:

// 🔴 BAD (Current)
serialize<Height - 1>::template apply(ar1, tuple);

// 🟢 GOOD (Remove 'template')
serialize<Height - 1>::apply(ar1, tuple);

Line 477:

// 🔴 BAD (Current)
pretty_tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply( ar, tuple );

// 🟢 GOOD (Remove 'template')
pretty_tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::apply( ar, tuple );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions