-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
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.
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: