intel / intel/libva-utils

Tests fail to build with Clang/libc++

Open
#186 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
241
Forks
172
PR merge metrics
No merged PRs in 30d

Description

```c++
$ export CC=clang CXX=clang++ CXXFLAGS=-stdlib=libc++
$ meson -Dtests=true _build
$ ninja -C _build
FAILED: test/9f86d08@@gtest@sta/gtest_src_gtest-all.cc.o
clang++ -Itest/9f86d08@@gtest@sta -Itest -I../test -I../test/gtest -I../test/gtest/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -g -Wno-unused-parameter -Wno-sign-compare -DHAVE_VA_DRM=1 -DHAVE_VA_X11=1 -DHAVE_VA_WAYLAND=1 -stdlib=libc++ -fPIC -DGTEST_HAS_PTHREAD=1 -DGTEST_USE_OWN_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -DGTEST_HAS_TR1_TUPLE=1 -DPTHREADS -std=c++11 -MD -MQ 'test/9f86d08@@gtest@sta/gtest_src_gtest-all.cc.o' -MF 'test/9f86d08@@gtest@sta/gtest_src_gtest-all.cc.o.d' -o 'test/9f86d08@@gtest@sta/gtest_src_gtest-all.cc.o' -c ../test/gtest/src/gtest-all.cc
In file included from ../test/gtest/src/gtest-all.cc:39:
In file included from ../test/gtest/include/gtest/gtest.h:62:
In file included from ../test/gtest/include/gtest/gtest-param-test.h:192:
In file included from ../test/gtest/include/gtest/internal/gtest-param-util.h:50:
../test/gtest/include/gtest/gtest-printers.h:600:34: error: no member named 'tr1' in namespace 'std'
inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:605:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) {
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:610:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) {
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:615:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) {
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:620:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) {
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:625:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t,
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:632:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t,
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:639:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t,
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:646:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t,
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:653:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple& t,
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:661:18: error: no member named 'tr1' in namespace 'std'
const ::std::tr1::tuple& t,
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:875:43: error: no member named 'tr1' in namespace 'std'
static const size_t tuple_size = ::std::tr1::tuple_size::value;
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:875:59: error: unexpected type name 'Tuple': expected expression
static const size_t tuple_size = ::std::tr1::tuple_size::value;
^
../test/gtest/include/gtest/gtest-printers.h:875:67: error: no member named 'value' in the global namespace
static const size_t tuple_size = ::std::tr1::tuple_size::value;
~~^
../test/gtest/include/gtest/gtest-printers.h:878:33: error: no member named 'tr1' in namespace 'std'
struct tuple_element : ::std::tr1::tuple_element {};
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:882:29: error: no member named 'tr1' in namespace 'std'
const typename ::std::tr1::tuple_element::type>::type get(
~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:882:59: error: expected a qualified name after 'typename'
const typename ::std::tr1::tuple_element::type>::type get(
^
../test/gtest/include/gtest/gtest-printers.h:882:59: error: type-id cannot have a name
const typename ::std::tr1::tuple_element::type>::type get(
^~~~
../test/gtest/include/gtest/gtest-printers.h:882:66: error: non-friend class member 'type' cannot have a qualified name
const typename ::std::tr1::tuple_element::type>::type get(
~~^
../test/gtest/include/gtest/gtest-printers.h:882:66: warning: variable templates are a C++14 extension [-Wc++14-extensions]
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
ninja: build stopped: subcommand failed.
```
GoogleTest can be fixed by removing
https://github.com/intel/libva-utils/blob/ab0806b440100b747e11288a85f3f84ff467b0f8/test/meson.build#L8-L12
https://github.com/intel/libva-utils/blob/ab0806b440100b747e11288a85f3f84ff467b0f8/test/Makefile.am#L8-L12
but build still fails
```c++
In file included from ../test/test_internal.cpp:25:
../test/test.h:145:14: error: case value evaluates to 4294967295, which cannot be narrowed to type 'VAStatus' (aka 'int') [-Wc++11-narrowing]
case VA_STATUS_ERROR_UNKNOWN:
^
/usr/include/va/va.h:215:35: note: expanded from macro 'VA_STATUS_ERROR_UNKNOWN'
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
^
../test/test_va_api_fixture.cpp:42:7: error: parenthesized initialization of a member array is a GNU extension [-Wgnu-array-member-paren-init]
, drmDevicePaths({ "/dev/dri/renderD128", "/dev/dri/card0" })
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
while
https://github.com/intel/libva-utils/blob/ab0806b440100b747e11288a85f3f84ff467b0f8/test/Makefile.am#L89
also triggers
```c++
test_va_api_fixture.cpp:189:35: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
return VAConfigAttrib{type: t, value: VA_ATTRIB_NOT_SUPPORTED};
^~~~~
.type =
test_va_api_fixture.cpp:189:44: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
return VAConfigAttrib{type: t, value: VA_ATTRIB_NOT_SUPPORTED};
^~~~~~
.value =
test_va_api_createsurfaces.cpp:77:33: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
1, {type : attrib.type, value : mask });
^~~~~~
.type =
test_va_api_createsurfaces.cpp:77:53: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
1, {type : attrib.type, value : mask });
^~~~~~~
.value =
test_va_api_get_create_config.cpp:94:33: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
1, {type : attrib.type, value : mask }));
^~~~~~
.type =
test_va_api_get_create_config.cpp:94:53: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
1, {type : attrib.type, value : mask }));
^~~~~~~
.value =
test_va_api_get_create_config.cpp:104:33: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
1, {type : attrib.type, value : mask}),
^~~~~~
.type =
test_va_api_get_create_config.cpp:104:53: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
1, {type : attrib.type, value : mask}),
^~~~~~~
.value =
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.