Bug 259288 - graphics/qt5-wayland: fix build with clang 13 by adding <array>
Summary: graphics/qt5-wayland: fix build with clang 13 by adding <array>
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (Team)
URL:
Keywords:
Depends on:
Blocks: 258209
  Show dependency treegraph
 
Reported: 2021-10-19 21:57 UTC by Dimitry Andric
Modified: 2021-10-22 17:42 UTC (History)
1 user (show)

See Also:
tcberner: maintainer-feedback+


Attachments
graphics/qt5-wayland: Add include <array> to fix clang 13 build (1.01 KB, patch)
2021-10-19 21:59 UTC, Dimitry Andric
tcberner: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2021-10-19 21:57:51 UTC
During an exp-run for llvm 13 (see bug 258209), it turned out that graphics/qt5-wayland fails to build with clang 13:

In file included from main.cpp:32:
In file included from ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h:33:
../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h:145:40: error: implicit instantiation of undefined template 'std::array<Plane, 4>'
    std::array<Plane, MaxDmabufPlanes> m_planes;
                                       ^
/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
In file included from main.cpp:32:
In file included from ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h:33:
../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h:148:46: error: implicit instantiation of undefined template 'std::array<void *, 4>'
    std::array<EGLImageKHR, MaxDmabufPlanes> m_eglImages = { {EGL_NO_IMAGE_KHR, EGL_NO_IMAGE_KHR, EGL_NO_IMAGE_KHR, EGL_NO_IMAGE_KHR} };
                                             ^
/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
In file included from main.cpp:32:
In file included from ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h:33:
../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h:149:51: error: implicit instantiation of undefined template 'std::array<QOpenGLTexture *, 4>'
    std::array<QOpenGLTexture *, MaxDmabufPlanes> m_textures = { {nullptr, nullptr, nullptr, nullptr} };
                                                  ^
/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
3 errors generated.

This is because linuxdmabuf.h doesn't include the <array> header. Fix it by adding the include.
Comment 1 Dimitry Andric freebsd_committer 2021-10-19 21:59:33 UTC
Created attachment 228850 [details]
graphics/qt5-wayland: Add include <array> to fix clang 13 build
Comment 2 Tobias C. Berner freebsd_committer 2021-10-20 06:34:50 UTC
Comment on attachment 228850 [details]
graphics/qt5-wayland: Add include <array> to fix clang 13 build

lgtm

mfg Tobias
Comment 3 commit-hook freebsd_committer 2021-10-22 17:41:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5425bfb16f2f14ed7d3ffe138c5ee564b9e554bf

commit 5425bfb16f2f14ed7d3ffe138c5ee564b9e554bf
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-10-19 21:54:48 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-10-22 17:38:48 +0000

    graphics/qt5-wayland: fix build with clang 13 by adding <array>

    During an exp-run for llvm 13 (see bug 258209), it turned out that
    graphics/qt5-wayland fails to build with clang 13:

    In file included from main.cpp:32:
    In file included from ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h:33:
    ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h:145:40: error: implicit instantiation of undefined template 'std::array<Plane, 4>'
        std::array<Plane, MaxDmabufPlanes> m_planes;
                                           ^
    /usr/include/c++/v1/__tuple:219:64: note: template is declared here
    template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                                   ^
    In file included from main.cpp:32:
    In file included from ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h:33:
    ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h:148:46: error: implicit instantiation of undefined template 'std::array<void *, 4>'
        std::array<EGLImageKHR, MaxDmabufPlanes> m_eglImages = { {EGL_NO_IMAGE_KHR, EGL_NO_IMAGE_KHR, EGL_NO_IMAGE_KHR, EGL_NO_IMAGE_KHR} };
                                                 ^
    /usr/include/c++/v1/__tuple:219:64: note: template is declared here
    template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                                   ^
    In file included from main.cpp:32:
    In file included from ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h:33:
    ../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h:149:51: error: implicit instantiation of undefined template 'std::array<QOpenGLTexture *, 4>'
        std::array<QOpenGLTexture *, MaxDmabufPlanes> m_textures = { {nullptr, nullptr, nullptr, nullptr} };
                                                      ^
    /usr/include/c++/v1/__tuple:219:64: note: template is declared here
    template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                                   ^
    3 errors generated.

    This is because linuxdmabuf.h doesn't include the <array> header. Fix it
    by adding the include.

    PR:             259288
    Approved by:    tcberner (maintainer)
    MFH:            2021Q4

 graphics/qt5-wayland/Makefile                                 |  2 +-
 ...on_compositor_linux-dmabuf-unstable-v1_linuxdmabuf.h (new) | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)