-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
P0608R3 breaks flang build with Clang #4959
Comments
Can you please attach a preprocessed source file that reproduces this error? |
Ah, I completely forgot about this option. I've added |
Reduced: #include <variant>
#include <optional>
struct Name {};
struct DefinedOperator {};
struct Abstract {};
struct GenericSpec {
template <typename A>
GenericSpec(A &&x) : u(x) {}
GenericSpec(GenericSpec &&) = default;
std::variant<Name, DefinedOperator> u;
};
struct InterfaceStmt {
template <typename A>
InterfaceStmt(A &&x) : u(x) {}
InterfaceStmt(InterfaceStmt &&) = default;
std::variant<std::optional<GenericSpec>, Abstract> u;
}; |
We have some constraints in FWIW the only obvious workaround I see is to constrain the converting constructor templates on all 39243 of these parse node types to require that the I'm still not 100% of the proximal cause. "Something" is trying to determine if |
`variant`'s converting constructor and assignment operator templates are constrained to reject arguments of the `variant`'s type. In such a case, the templates instantiated to check the constructibility constraint might be ill-formed outside the immediate context of template instantiation causing a hard error. We should split the constraints into multiple `enable_if_t`s to enable short-circuiting of later constraints when the earlier constraints fail. Fixes microsoft#4959.
It seems that only the type that contains |
@cpplearner did you make any progress in fixing this in flang? I'm seeing it with clang 19.1.4 and VS 17.12.2 after a VS update yesterday. I can look into fixing it if you haven't already? |
Sorry, I just read the linked issues as well. It looks like this was broken in a PR (#4713) and then fixed in a later one (#4966). I guess #4713 made it into 17.12.2 but #4966 won't make it until 17.13p1, if I am reading things correctly? |
Yes, that is correct.
#4713 was in 17.12 preview 1 - long before 17.12.2 - but essentially yes.
I think the options are:
I'd prefer (1), but then I work almost exclusively with the current preview compiler so it's normal for me. EDIT: I apologize for not reporting this in the LLVM repo to raise visibility, I suppose at the time I thought the issue reporter would do so. |
Ok, I think I'll add an error in the CMake for |
Yes, except I'd suggest the LTSC 17.10 rather than 17.11 for which support ended when 17.12 released. |
After merging #4713, Clang (18.1.8 and HEAD tested) fails to compile anything including
flang/include/flang/Parser/parse-tree.h
with errors like this:Repro is complicated because generated "*.inc" files are required.
I tried to reduce failing code size, including only the code necessary for
DefinedOperator
structure definition to compile, but the problem disappears under these conditions.Not sure if this a bug in STL or in Clang (or both), the latest Visual C++ 19.42.34321.1 (from 17.12.0 preview 2.0) compiles flang just fine.
The text was updated successfully, but these errors were encountered: