Tests fail to build with Clang/libc++

オープン
#186 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp

調査の方向性

まず Meson で Clang/libc++ のビルドを再現し、その後 test/meson.build、test/Makefile.am、および vendored GoogleTest ヘッダーを調査します。test.h、test_va_api_fixture.cpp、および old-style designator エラーを報告しているファイルを確認します。示されている Clang/libc++ 構成でテストスイートのビルドが成功し、意図された診断を弱めていなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

$ 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 =
主要言語
C
スター
244
フォーク
175
平均マージ
9日 7時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

intel/libva-utils のほかの issue

intel/libva-utils の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。