-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation with gcc 8.1 fails due to missing cast on unique_ptr #1692
Labels
build
Issues related to build and setup
Comments
Thanks for reporting and detailed information :) |
mfwitten
added a commit
to mfwitten/SPIRV-LLVM
that referenced
this issue
Sep 21, 2019
The aging LLVM code is converting an object of type `unique_ptr` to an object of type `bool`, but is doing so implicitly, thereby causing a compile-time error with modern, standards-compliant compilers. This is explained well here: microsoft/DirectXShaderCompiler#1692 In particular: > The C++ standard specifies operator bool on unique_ptr > as being explicit, so this is clearly a bug in the LLVM > source code: https://en.cppreference.com/w/cpp/memory/unique_ptr/operator_bool This commit merely makes the conversion explicit, allowing the code to be built by GCC version 9.1.0. This bug was fixed by the LLVM project proper as part of the following commit (more than 4 years ago): 69341e6abca92f7f118ee7bd99be0cdfc649386f llvm/llvm-project@69341e6
mfwitten
added a commit
to mfwitten/SPIRV-LLVM
that referenced
this issue
Sep 21, 2019
The aging LLVM code is converting an object of type `unique_ptr` to an object of type `bool`; this is being done implicitly, thereby causing a compile-time error with a modern, standards-compliant compiler. This is explained well here: microsoft/DirectXShaderCompiler#1692 In particular: > The C++ standard specifies operator bool on unique_ptr as being > explicit, so this is clearly a bug in the LLVM source code: > https://en.cppreference.com/w/cpp/memory/unique_ptr/operator_bool This commit merely makes the conversion explicit, allowing the code to be built by GCC version 9.1.0. This bug was fixed by the LLVM project proper as part of the following commit: 69341e6abca92f7f118ee7bd99be0cdfc649386f 2016-04-08 llvm/llvm-project@69341e6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Title
Compilation with gcc 8.1 fails due to missing explicit cast on unique_ptr
Functional impact
It is not possible to build dxc on systems that use gcc 8.1 or newer (such as Debian testing).
Minimal repro steps
Attempt compilation with cmake 3.12.3 and gcc 8.2.0, although the issue is also present in gcc 8.1.
Expected result
Compilation succeeds.
Actual result
The following compilation error is thrown:
Further technical details
This is a known issue that has been reported and fixed elsewhere: digego/extempore#318
The C++ standard specifies
operator bool
onunique_ptr
as being explicit, so this is clearly a bug in the LLVM source code: https://en.cppreference.com/w/cpp/memory/unique_ptr/operator_boolIt can be fixed by adding an explicit cast:
or:
The text was updated successfully, but these errors were encountered: