Tests fail to build with Clang/libc++

Offen
#186 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
cpp

Rechercherichtung

Beginne damit, den Clang/libc++-Build mit Meson zu reproduzieren, und sieh dir dann test/meson.build, test/Makefile.am und die vendorten GoogleTest-Header an. Überprüfe test.h, test_va_api_fixture.cpp und die Dateien, die Fehler zu old-style designator melden. Als abgeschlossen gilt die Aufgabe, wenn die Testsuite mit der gezeigten Clang/libc++-Konfiguration erfolgreich erstellt wird, ohne die beabsichtigten Diagnosen abzuschwächen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

$ 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 =
Vorherrschende Sprache
C
Sterne
244
Forks
175
Ø Merge
9 T. 7 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus intel/libva-utils

Alle Issues in intel/libva-utils

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.