Skip to content

Commit

Permalink
Make code compile on clang-18
Browse files Browse the repository at this point in the history
To do this requires fixing some minor warnings around templates.

stdexec uses variables of the form __foo to denote variables that aren't
used.  This throws some warnings when trying to compile with clang.

Update the meson file to ignore those warnings when we detect clang.

With this change, and clang-18, code now compiles.

Change-Id: I72bc0ab7a818b7913831749b6246f54e7b092e0b
Signed-off-by: Ed Tanous <[email protected]>
  • Loading branch information
edtanous committed Feb 26, 2024
1 parent 8723a54 commit e12a23c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion include/sdbusplus/async/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
// as needed.

#pragma GCC diagnostic push
#ifndef __clang__
#ifdef __clang__
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wnon-pod-varargs"
#else
#pragma GCC diagnostic ignored "-Wnon-template-friend"
#endif
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
Expand Down
6 changes: 3 additions & 3 deletions include/sdbusplus/async/proxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ struct proxy : private sdbusplus::bus::details::bus_friend
requires(!Preserved)
{
using result_t = proxy<S, P, I, true>;
return result_t(typename result_t::value_t<S>(this->s),
typename result_t::value_t<P>(this->p),
typename result_t::value_t<I>(this->i));
return result_t(typename result_t::template value_t<S>(this->s),
typename result_t::template value_t<P>(this->p),
typename result_t::template value_t<I>(this->i));
}

/** Perform a method call.
Expand Down
2 changes: 1 addition & 1 deletion tools/sdbusplus/templates/interface.client.hpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ${interface.classname} :
{
public:
friend Client;
template <typename>
template <typename, typename>
friend struct sdbusplus::client::${interface.cppNamespacedClass()};

// Delete default constructor as these should only be constructed
Expand Down

0 comments on commit e12a23c

Please sign in to comment.