This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]