https://bugs.llvm.org/show_bug.cgi?id=47451
Bug ID: 47451
Summary: struct initialization fails in recursive case
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: kirsha...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk
template<std::size_t INDEX, typename... Ts>
struct A;
template<std::size_t INDEX, typename T>
struct A<INDEX, T> {
T t;
// problem "resolves" if we add this ctor
// template<typename U>
// A(U&& u): t{u} {}
};
template<std::size_t INDEX, typename T, typename... Ts>
struct A<INDEX, T, Ts...>: A<INDEX+1, Ts...>, A<INDEX, T> {
template<typename U, typename... Us>
A(U&& u, Us&&... us): A<INDEX+1, Ts...>(std::forward<Us>(us)...), A<INDEX,
T>{std::forward<U>(u)} {}
};
int main() {
A<0,int> a1{3}; // ok
A<0,int,int> a2{3, 3}; // fails
}
// code in compiler explorer: https://godbolt.org/z/K8afeK
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs