Tests fail to build with Clang/libc++

Aperta
#186 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp

Direzione di ricerca

Inizia riproducendo la compilazione di Clang/libc++ con Meson, quindi esamina test/meson.build, test/Makefile.am e gli header GoogleTest vendorizzati. Controlla test.h, test_va_api_fixture.cpp e i file che segnalano errori di old-style designator. Il lavoro è completo quando la suite di test viene compilata correttamente con la configurazione Clang/libc++ mostrata, senza indebolire le diagnostiche previste.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

$ 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<T1>& 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<T1, T2>& 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<T1, T2, T3>& 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<T1, T2, T3, T4>& 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<T1, T2, T3, T4, T5>& t,
                   ~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:632:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
                   ~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:639:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
                   ~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:646:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
                   ~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:653:27: error: no member named 'tr1' in namespace 'std'
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
                   ~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:661:18: error: no member named 'tr1' in namespace 'std'
    const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& 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<Tuple>::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<Tuple>::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<Tuple>::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<I, Tuple> {};
                         ~~~~~~~^
../test/gtest/include/gtest/gtest-printers.h:882:29: error: no member named 'tr1' in namespace 'std'
      const typename ::std::tr1::tuple_element<I, Tuple>::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<I, Tuple>::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<I, Tuple>::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<I, Tuple>::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

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

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 =
Lingua principale
C
Stelle
244
Fork
175
Merge medio
9g 7h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di intel/libva-utils

Tutte le issue di intel/libva-utils

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.