[Mesa-dev] [PATCH 08/15] glsl: Switch ast_type_qualifier to a 128-bit bitset.

Francisco Jerez currojerez at riseup.net
Sun Feb 25 02:35:07 UTC 2018


Roland Scheidegger <sroland at vmware.com> writes:

> This seems to have broken compilation with some gcc versions (with scons
> build):
>
> In file included from src/compiler/glsl/ast_array_index.cpp:24:0:
> src/compiler/glsl/ast.h:648:16: error: member
> ‘ast_type_qualifier::bitset_t ast_type_qualifier::flags::i’ with
> constructor not allowed in union
>        bitset_t i;
>                 ^

Oops...  And the only reason bitset_t has a default constructor was...
to avoid using another C++11 feature (defaulted member functions).
Does the attached patch fix the build failure for you?  The cleaner
alternative would be to define the default constructor of the bitset
object like 'T() = default', but that would imply dropping support for
GCC 4.2-4.3 which don't implement the feature...

> src/compiler/glsl/ast.h:648:16: note: unrestricted unions only available
> with -std=c++11 or -std=gnu++11
> scons: *** [build/linux-x86_64-checked/compiler/glsl/ast_array_index.os]
> Error 1
> src/gallium/tests/unit/u_format_test.c: In function ‘main’:
> src/gallium/tests/unit/u_format_test.c:649:44: warning: array subscript
> is above array bounds [-Warray-bounds]
>           unpacked[i][j] = test->unpacked[i][j][1];
>                                             ^
> In file included from src/compiler/glsl/ast_expr.cpp:24:0:
> src/compiler/glsl/ast.h:648:16: error: member
> ‘ast_type_qualifier::bitset_t ast_type_qualifier::flags::i’ with
> constructor not allowed in union
>        bitset_t i;
>                 ^
> src/compiler/glsl/ast.h:648:16: note: unrestricted unions only available
> with -std=c++11 or -std=gnu++11
>
> Roland
>
> [...]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-util-bitset-Make-C-wrapper-trivially-constructible.patch
Type: text/x-diff
Size: 5183 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180224/11578418/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180224/11578418/attachment-0001.sig>


More information about the mesa-dev mailing list