diff mbox series

[libgpiod] bindings: cxx: fix building with clang's libc++

Message ID b60a6c6efc4c41641e82dd5f91d036b97378de6b.1612312770.git.jan.kundrat@cesnet.cz
State New
Headers show
Series [libgpiod] bindings: cxx: fix building with clang's libc++ | expand

Commit Message

Jan Kundrát Feb. 3, 2021, 12:15 a.m. UTC
This is what I get on clang 11 with libc++:

 line.cpp:248:39: error: implicit instantiation of undefined template 'std::__1::array<gpiod_line_event, 16>'
         ::std::array<::gpiod_line_event, 16> event_buf;
                                              ^
 /nix/store/vk8ynr4hj2a8w7g1b9m8wknzj39iiv4x-libc++-11.0.1/include/c++/v1/__tuple:219:64: note: template is declared here
 template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;

Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
---
 bindings/cxx/line.cpp | 1 +
 1 file changed, 1 insertion(+)

Comments

Bartosz Golaszewski Feb. 3, 2021, 12:30 p.m. UTC | #1
On Wed, Feb 3, 2021 at 1:52 AM Jan Kundrát <jan.kundrat@cesnet.cz> wrote:
>
> This is what I get on clang 11 with libc++:
>
>  line.cpp:248:39: error: implicit instantiation of undefined template 'std::__1::array<gpiod_line_event, 16>'
>          ::std::array<::gpiod_line_event, 16> event_buf;
>                                               ^
>  /nix/store/vk8ynr4hj2a8w7g1b9m8wknzj39iiv4x-libc++-11.0.1/include/c++/v1/__tuple:219:64: note: template is declared here
>  template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
>
> Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
> ---
>  bindings/cxx/line.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git bindings/cxx/line.cpp bindings/cxx/line.cpp
> index bf4a3eb..9b66d1a 100644
> --- bindings/cxx/line.cpp
> +++ bindings/cxx/line.cpp
> @@ -6,6 +6,7 @@
>   */
>
>  #include <gpiod.hpp>
> +#include <array>
>  #include <map>
>  #include <system_error>
>
> --
> 2.29.0
>
>

Applied, thanks!

Bartosz
diff mbox series

Patch

diff --git bindings/cxx/line.cpp bindings/cxx/line.cpp
index bf4a3eb..9b66d1a 100644
--- bindings/cxx/line.cpp
+++ bindings/cxx/line.cpp
@@ -6,6 +6,7 @@ 
  */
 
 #include <gpiod.hpp>
+#include <array>
 #include <map>
 #include <system_error>