<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - error: cannot compile this weird std::initializer_list yet on variadic initialization"
href="https://llvm.org/bugs/show_bug.cgi?id=23050">23050</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>error: cannot compile this weird std::initializer_list yet on variadic initialization
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eliben@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>This code:
namespace std
{
typedef unsigned long size_t;
template<class _E>
class initializer_list
{
public:
typedef _E value_type;
typedef const _E& reference;
typedef const _E& const_reference;
typedef size_t size_type;
typedef const _E* iterator;
typedef const _E* const_iterator;
private:
iterator _M_array;
size_type _M_len;
constexpr initializer_list(const_iterator __a, size_type __l)
: _M_array(__a), _M_len(__l) { }
public:
constexpr initializer_list() noexcept
: _M_array(0), _M_len(0) { }
};
}
template <typename T, std::size_t n>
class array {
public:
array(std::initializer_list<T> l) {}
};
template <typename Ty>
struct KKK {
template<typename... Tys>
void foo(Ty first, Tys... others) {
const std::size_t NumTys = sizeof...(others) + 1;
array<Ty, NumTys> dims = {first, others...};
}
};
void moo() {
KKK<int> blob;
blob.foo(10, 20, 30, 40);
}
Compiled with upstream Clang (ToT):
$ clang++ -cc1 -x cuda -std=gnu++11 -triple nvptx64-unknown-unknown
-emit-llvm -o /dev/null ~/test/variadictest.cc
test/variadictest.cc:39:30: error: cannot compile this weird
std::initializer_list yet
array<Ty, NumTys> dims = {first, others...};
^~~~~~~~~~~~~~~~~~
1 error generated.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>