-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Closed
Labels
bugDeprecated. Please set Type to Bug instead.Deprecated. Please set Type to Bug instead.c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 conceptsregressionrejects-valid
Description
Caught this testing MSVCSTL with 16-rc2. Our implementation of std::ranges::subrange has the dependent constraint. I suspect inheriting from subrange is fairly rare, and have a workaround, so this isn't a release blocker.
Compiling this well-formed TU:
template <class> struct B {
static constexpr bool meow = false;
};
template <class T>
struct D : B<T> {
template <int = 42>
D(int) requires (!B<T>::meow) {}
};
struct S : D<void> { using D::D; };
int main() { S{42}; }with clang++ -std=c++20 -fsyntax-only diagnoses (https://godbolt.org/z/8a7Maa63e):
repro.cpp:8:20: error: substitution into constraint expression resulted in a non-constant expression
D(int) requires (!B<T>::meow) {}
^~~~~~~~~~~
repro.cpp:13:14: note: while checking constraint satisfaction for function 'D' required here
int main() { S{42}; }
^
repro.cpp:8:20: note: non-literal type '<dependent type>' cannot be used in a constant expression
D(int) requires (!B<T>::meow) {}
^
1 error generated.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugDeprecated. Please set Type to Bug instead.Deprecated. Please set Type to Bug instead.c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 conceptsregressionrejects-valid
Type
Projects
Status
No status