This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48736] New: [C++0x] ICE during list-initialization with variadics
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Apr 2011 21:31:44 +0000
- Subject: [Bug c++/48736] New: [C++0x] ICE during list-initialization with variadics
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48736
Summary: [C++0x] ICE during list-initialization with variadics
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
CC: jason@redhat.com
The following code causes an internal compiler error with gcc 4.7.0 20110422
(experimental) in C++0x mode at the line marked with X:
//-------------
template<class T>
T&& create();
template<class T, class... Args,
class = decltype(T{create<Args>()...}) // Line X
>
char f(int);
//-------------
"internal compiler error: tree check: expected tree_vec, have
expr_pack_expansion in tsubst_copy_and_build, at cp/pt.c:13227"
For those who need this kind of sfinae-like expression: The current workaround
is to rewrite above code into the following form:
//-------------
template<class T>
T&& create();
template<class T, class... Args>
decltype(T{create<Args>()...}, char()) f(int);
//-------------