Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#22 closed defect (fixed)

Basic types in forall/trait allowed

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

Description

Are either of these allowed?

forall( int T ) g() {}

trait X(int T) {
    int h();
};

If not, they need a better error message:

cfa test.c
CFA Version 1.0.0 (debug)
*CFA assertion error* "false" from program "cfa-cpp" in "void buildList(const NodeType*, Container<SynTreeType*, Args ...>&) [with SynTreeType = TypeDecl; NodeType = DeclarationNode; Container = std::__cxx11::list; Args = {std::allocator<TypeDecl*>}]" at line 424 in file "Parser/ParseNode.h": buildList unknown type
Stack back trace for: /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp
(0) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : void buildList<TypeDecl, DeclarationNode, std::__cxx11::list, std::allocator<TypeDecl*> >(DeclarationNode const*, std::__cxx11::list<TypeDecl*, std::allocator<TypeDecl*> >&)+0xce [0x5a7ede]
(1) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : void buildForall<std::__cxx11::list<TypeDecl*, std::allocator<TypeDecl*> > >(DeclarationNode const*, std::__cxx11::list<TypeDecl*, std::allocator<TypeDecl*> >&)+0x32 [0x5a7ff2]
(2) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : buildFunction(TypeData const*)+0xde [0x5a7a5e]
(3) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : buildDecl(TypeData const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Type::StorageClasses, Expression*, Type::FuncSpecifiers, LinkageSpec::Spec, ConstantExpr*, Initializer*, std::__cxx11::list<Attribute*, std::allocator<Attribute*> >)+0x1cc [0x5a768c]
(4) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : DeclarationNode::build() const+0x2bf [0x59688f]
(5) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : buildList(DeclarationNode const*, std::__cxx11::list<Declaration*, std::allocator<Declaration*> >&)+0xba [0x5973aa]
(6) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : main(/*unknown*/)+0x492 [0x4b0712]

Change History (4)

comment:1 Changed 5 years ago by Thierry Delisle

Owner: set to pabuhr
Status: newassigned

comment:2 Changed 5 years ago by Peter A. Buhr <pabuhr@…>

Resolution: fixed
Status: assignedclosed

In 3e274ab:

replace assert with unimplemented semantic error [fixes #22]

comment:3 Changed 5 years ago by Peter A. Buhr <pabuhr@…>

In 3e274ab:

replace assert with unimplemented semantic error [fixes #22]

comment:4 Changed 5 years ago by Peter A. Buhr <pabuhr@…>

In 3e274ab:

replace assert with unimplemented semantic error [fixes #22]

Note: See TracTickets for help on using tickets.