[Spice-devel] [PATCH 1/2] Add missing <string> header
Frediano Ziglio
fziglio at redhat.com
Fri Feb 16 16:06:43 UTC 2018
>
> From: Christophe de Dinechin <dinechin at redhat.com>
>
> Without this header, clang complains with messages such as:
>
> concrete-agent.cpp:62:37: error: invalid operands to binary expression
> ('const std::string' (aka 'const basic_string<char, char_traits<char>,
> allocator<char> >') and 'const char *')
> std::string pattern = directory + "/*.so";
> ~~~~~~~~~ ^ ~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:743:1:
> note: candidate template ignored: could not match
> 'reverse_iterator<type-parameter-0-0>' against 'char const[6]'
> operator+(typename reverse_iterator<_Iter>::difference_type __n, const
> reverse_iterator<_Iter>& __x)
> ^
>
> Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
> ---
> src/concrete-agent.cpp | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/concrete-agent.cpp b/src/concrete-agent.cpp
> index 891c09b..ac37788 100644
> --- a/src/concrete-agent.cpp
> +++ b/src/concrete-agent.cpp
> @@ -9,6 +9,7 @@
> #include <syslog.h>
> #include <glob.h>
> #include <dlfcn.h>
> +#include <string>
>
> #include "concrete-agent.hpp"
> #include "static-plugin.hpp"
Acked.
I suppose on clang the std::string is defined in another header.
Is weird that got basic_string and std::string declarations but not
its operators.
Frediano
More information about the Spice-devel
mailing list