Opened 3 years ago

#108 new defect

tuple overloading problem

Reported by: pabuhr Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

void fred( int i1, int i2 );
int fred( int i1, int i2 );
[int, int] fred( int i1, int i2 ) {}
int main() {
    int i;
    [i, i] = fred( 4, 5 );
}
cfa-cpp: Tuples/TupleAssignment.cc:300: ObjectDecl* Tuples::TupleAssignSpotter::Matcher::newObject(UniqueName&, Expression*): Assertion `expr->result && ! expr->get_result()->isVoid()' failed.
Stack back trace for: /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp
(0) /lib/x86_64-linux-gnu/libc.so.6 : (/*unknown*/)+0x2dc82 [0x7f2e2b823c82]
(1) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : Tuples::TupleAssignSpotter::Matcher::newObject(UniqueName&, Expression*)+0x261 [0xec2311]
(2) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : Tuples::TupleAssignSpotter::MassAssignMatcher::match(std::__cxx11::list<Expression*, std::allocator<Expression*> >&)+0x204 [0xec2544]
(3) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : Tuples::TupleAssignSpotter::match()+0x57 [0xec18c7]
(4) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : Tuples::TupleAssignSpotter::spot(UntypedExpr*, std::vector<ResolvExpr::AlternativeFinder, std::allocator<ResolvExpr::AlternativeFinder> >&)+0x308 [0xec2e28]
(5) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : Tuples::handleTupleAssignment(ResolvExpr::AlternativeFinder&, UntypedExpr*, std::vector<ResolvExpr::AlternativeFinder, std::allocator<ResolvExpr::AlternativeFinder> >&)+0x42 [0xec3242]
(6) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::Finder::postvisit(UntypedExpr*)+0xfd [0xb9cb1d]
(7) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::AlternativeFinder::Finder>::visit(UntypedExpr*)+0xfa [0xbbafda]
(8) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::find(Expression*, bool, bool, bool)+0xb1 [0xb9a561]
(9) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::Finder::postvisit(CastExpr*)+0xd3 [0xb9da03]
(10) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::AlternativeFinder::Finder>::visit(CastExpr*)+0xb5 [0xbbb105]
(11) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::find(Expression*, bool, bool, bool)+0xb1 [0xb9a561]
(12) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp() [0xc68ac5]
(13) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::resolveInVoidContext(Expression*, SymTab::Indexer const&, ResolvExpr::TypeEnvironment&)+0xe0 [0xc69040]
(14) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::findVoidExpression(Expression*&, SymTab::Indexer const&)+0x4a [0xc692da]
(15) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(ExprStmt*)+0x53 [0xca4173]
(16) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : void PassVisitor<ResolvExpr::Resolver>::handleStatementList<PassVisitor<ResolvExpr::Resolver>::visitStatementList(std::__cxx11::list<Statement*, std::allocator<Statement*> >&)::{lambda(Statement*)#1}>(std::__cxx11::list<Statement*, std::allocator<Statement*> >&, PassVisitor<ResolvExpr::Resolver>::visitStatementList(std::__cxx11::list<Statement*, std::allocator<Statement*> >&)::{lambda(Statement*)#1})+0x18b [0xca774b]
(17) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(CompoundStmt*)+0x69 [0xca7b09]
(18) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(FunctionDecl*)+0x1a1 [0xca7d61]
(19) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::resolve(std::__cxx11::list<Declaration*, std::allocator<Declaration*> >)+0x121 [0xc8c621]
(20) /u0/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : main(/*unknown*/)+0x687 [0x71f817]

Change History (0)

Note: See TracTickets for help on using tickets.