Patch for std::get<>() problem with Windows LLVM clang #2
Open
lovemycatt wants to merge 3 commits into
Open
Conversation
Owner
|
Thank you very much for this contribution. I need to review since it breaks some compilations on XCode : https://travis-ci.org/duckie/named_types/builds/229891574 I am surprised the Travis result doesnt show here. |
Author
|
Thanks for taking it into consideration. |
Owner
|
@lovemycatt I fixed a discrepancy in the code that fixes the Linux build and should still work with MSVC. Can you try it ? You gotta pull my feature branch into yours (same name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These patches are required in order to build on Windows with LLVM clang 5.0 toolset (either with mingw or with MSVC using LLVM-vs2014 toolset).
Basically, the encountered problem is that, under certain (many) conditions,
std::get<>()is not able to cast anamed_tuple<>or atagged_tuple<>to its basestd::tuple<>.This is the case, for instance, of the
named_tuple::operator[].I believe this is a bug of the Windows version of LLVM clang distribution, anyways the patched code introduces no overhead and is quite simple.
The proposed solution implements to patches:
std::tuple<>instd::get<>()calls intagged.hpp(a simple solution, yet nor general as other client code may usestd::get<>()on atagged_tuple<>);std::get<>()functions fornamed_tuple<>innamed_tuple.hpp(a bit longer solution, but more general, also fixes al client code that usesstd::get<>()onnamed_tuple<>and, as far as I have seen, on any other derived classes).I'd be curious to know your opinion on this strange LLVM 'bug', and if you can imagine better solutions (other than working on Linux :)).
Follows a sample error log: