Skip to content

Commit e32a62c

Browse files
authored
[clang][NFC] Add regression tests for GH63782 (#109104)
Patch by Alejandro Alvarez Ayllon! CPP-5380
1 parent c59ac1a commit e32a62c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

clang/test/SemaTemplate/concepts-out-of-line-def.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,3 +622,47 @@ void A<T>::method(Ts&... ts)
622622
} {}
623623

624624
}
625+
626+
namespace GH63782 {
627+
// GH63782 was also fixed by PR #80594, so let's add a test for it.
628+
629+
template<bool... Vals>
630+
constexpr bool All = (Vals && ...);
631+
632+
template<bool... Bs>
633+
class Class {
634+
template<typename>
635+
requires All<Bs...>
636+
void Foo();
637+
};
638+
639+
template<bool... Bs>
640+
template<typename>
641+
requires All<Bs...>
642+
void Class<Bs...>::Foo() {
643+
};
644+
645+
} // namespace GH63782
646+
647+
namespace eve {
648+
// Reduced from the "eve" project
649+
650+
template <typename... Ts>
651+
struct tuple {
652+
template <int I0> requires(I0 <= sizeof...(Ts))
653+
constexpr auto split();
654+
};
655+
656+
template <typename... Ts>
657+
template <int I0>
658+
requires(I0 <= sizeof...(Ts))
659+
constexpr auto tuple<Ts...>::split(){
660+
return 0;
661+
}
662+
663+
int foo() {
664+
tuple<int, float> x;
665+
return x.split<0>();
666+
}
667+
668+
} // namespace eve

0 commit comments

Comments
 (0)