ICE when calling templated function from extern (C++) templated function?

Elronnd via D.gnu d.gnu at puremagic.com
Tue Dec 27 22:51:42 PST 2016


Here's a minimal example:

   void r(T...)(T args) {}

   extern (C++) {
           void s(T...)(T args) { r(args); }
   }

   void main() {
           s(0);
   }

Traceback from GDC:

   cc1d: ../../gcc-6.3.0/gcc/d/dfrontend/cppmangle.c:185: void 
CppMangleVisitor::source_name(Dsymbol*, bool): Assertion `t' 
failed.
   minim.d: In function ‘D main’:
   minim.d:9:2: internal compiler error: Aborted
     s(0);
     ^
   0xb91c3f crash_signal
         ../../gcc-6.3.0/gcc/toplev.c:333
   0x5f4f26 CppMangleVisitor::source_name(Dsymbol*, bool)
         ../../gcc-6.3.0/gcc/d/dfrontend/cppmangle.c:185
   0x5f0b82 CppMangleVisitor::mangle_function(FuncDeclaration*)
         ../../gcc-6.3.0/gcc/d/dfrontend/cppmangle.c:462
   0x5f0b82 CppMangleVisitor::mangleOf(Dsymbol*)
         ../../gcc-6.3.0/gcc/d/dfrontend/cppmangle.c:575
   0x5f0b82 toCppMangle(Dsymbol*)
         ../../gcc-6.3.0/gcc/d/dfrontend/cppmangle.c:910
   0x67ba17 Mangler::visit(Declaration*)
         ../../gcc-6.3.0/gcc/d/dfrontend/mangle.c:421
   0x67a2f8 mangleExact(FuncDeclaration*)
         ../../gcc-6.3.0/gcc/d/dfrontend/mangle.c:877
   0x6ed183 get_symbol_decl(Declaration*)
         ../../gcc-6.3.0/gcc/d/d-decls.cc:164
   0x72ab78 ExprVisitor::visit(VarExp*)
         ../../gcc-6.3.0/gcc/d/expr.cc:2062
   0x7298ef build_expr(Expression*, bool)
         ../../gcc-6.3.0/gcc/d/expr.cc:2851
   0x72b759 ExprVisitor::visit(CallExp*)
         ../../gcc-6.3.0/gcc/d/expr.cc:1633
   0x7298ef build_expr(Expression*, bool)
         ../../gcc-6.3.0/gcc/d/expr.cc:2851
   0x729a5f build_expr_dtor(Expression*)
         ../../gcc-6.3.0/gcc/d/expr.cc:2895
   0x731d7c IRVisitor::visit(ExpStatement*)
         ../../gcc-6.3.0/gcc/d/toir.cc:649
   0x731bf8 IRVisitor::visit(CompoundStatement*)
         ../../gcc-6.3.0/gcc/d/toir.cc:665
   0x731b95 build_ir(FuncDeclaration*)
         ../../gcc-6.3.0/gcc/d/toir.cc:1037
   0x706d84 FuncDeclaration::toObjFile()
         ../../gcc-6.3.0/gcc/d/d-objfile.cc:1359
   0x7083a4 Module::genobjfile(bool)
         ../../gcc-6.3.0/gcc/d/d-objfile.cc:1465
   0x6e7f22 d_parse_file()
         ../../gcc-6.3.0/gcc/d/d-lang.cc:1215
   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.


More information about the D.gnu mailing list