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++/58734] New: [C++11] Template template parameter pack instantiation problem


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58734

            Bug ID: 58734
           Summary: [C++11] Template template parameter pack instantiation
                    problem
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roger.ferrer at bsc dot es

Hi,

this code fails to compile in g++ 4.9.0 20131015

// -- test.cc
template <typename R1, typename R2>
struct W1 { };

template <template <typename, typename> class W>
struct A { };

template <template <typename, typename> class ...W>
struct B { };

template <template <typename, typename> class ...W>
void f(A<W...> &a, B<W...> &b);

void g()
{
    A<W1> a;
    B<W1> b;

    ::f(a, b);
}
// -- end of test.cc

$ g++ -std=c++11 -c test.cc
test.cc: In instantiation of âvoid f(A<W ...>&, B<W ...>&) [with W = {W1}]â:

test.cc:18:6: internal compiler error: tree check: expected class âtypeâ, have
âdeclarationâ (template_decl) in write_CV_qualifiers_for_type, at
cp/mangle.c:2160
 void f(A<W...> &a, B<W...> &b);
      ^
0xcfa309 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
    ../../gcc-svn/gcc/tree.c:9351
0x6e3b43 tree_class_check
    ../../gcc-svn/gcc/tree.h:2797
0x6e3b43 write_CV_qualifiers_for_type
    ../../gcc-svn/gcc/cp/mangle.c:2160
0x6ed271 write_type
    ../../gcc-svn/gcc/cp/mangle.c:1893
0x6edd25 write_type
    ../../gcc-svn/gcc/cp/mangle.c:2065
0x6f16c8 write_template_args
    ../../gcc-svn/gcc/cp/mangle.c:2551
0x6e9adb write_name
    ../../gcc-svn/gcc/cp/mangle.c:821
0x6ed89b write_class_enum_type
    ../../gcc-svn/gcc/cp/mangle.c:2522
0x6ed89b write_type
    ../../gcc-svn/gcc/cp/mangle.c:1989
0x6edb85 write_type
    ../../gcc-svn/gcc/cp/mangle.c:2060
0x6ef2b7 write_method_parms
    ../../gcc-svn/gcc/cp/mangle.c:2509
0x6ef6ce write_bare_function_type
    ../../gcc-svn/gcc/cp/mangle.c:2451
0x6ea41d write_mangled_name
    ../../gcc-svn/gcc/cp/mangle.c:689
0x6f2dd5 mangle_decl_string
    ../../gcc-svn/gcc/cp/mangle.c:3446
0x6f3008 get_mangled_id
    ../../gcc-svn/gcc/cp/mangle.c:3468
0x6f3008 mangle_decl(tree_node*)
    ../../gcc-svn/gcc/cp/mangle.c:3491
0xcfbd80 decl_assembler_name(tree_node*)
    ../../gcc-svn/gcc/tree.c:582
0x7f4b44 insert_to_assembler_name_hash
    ../../gcc-svn/gcc/symtab.c:117
0x7f4ca1 symtab_initialize_asm_name_hash
    ../../gcc-svn/gcc/symtab.c:344
0x802628 analyze_functions
    ../../gcc-svn/gcc/cgraphunit.c:1109
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions

Kind regards,

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