[Bug c++/48736] New: [C++0x] ICE during list-initialization with variadics

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Fri Apr 22 21:31:00 GMT 2011


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);
//-------------



More information about the Gcc-bugs mailing list