My guess is that there is a leading space (seem to be in the error message). Should add quotes in the error message ...
Sylvain On Fri, Jul 18, 2014 at 3:50 PM, Janosch Machowinski <[email protected]> wrote: > Hey, > I try to generate a typlib enum, but typelib throws an BadName()... > > enum FOO > { > BAR = -5, > SEMMEL, > FOOBAR, > }; > > This is what I get from Clang: > TypeClassName Enum > DeclName FOO > Enum CONST BAR Value -5 > Enum CONST SEMMEL Value -4 > Enum CONST FOOBAR Value -3 > > This is the code I use to add the type : > Typelib::Enum *enumVal =new > Typelib::Enum(decl->getQualifiedNameAsString()); > > for(clang::EnumDecl::enumerator_iterator it = > decl->enumerator_begin(); it != decl->enumerator_end(); it++) > { > enumVal->add(it->getDeclName().getAsString(), > it->getInitVal().getSExtValue()); > std::cout << "Enum CONST " << it->getDeclName().getAsString() > << " Value " << it->getInitVal().getSExtValue() << std::endl; > } > > registry.add(enumVal); > > And this is my Error message : > terminate called after throwing an instance of 'Typelib::BadName' > what(): FOO is not a valid type name > > I don't get the error, a enum should be allowed to be named FOO... > Greetings > Janosch > > -- > Dipl. Inf. Janosch Machowinski > SAR- & Sicherheitsrobotik > > Universität Bremen > FB 3 - Mathematik und Informatik > AG Robotik > Robert-Hooke-Straße 1 > 28359 Bremen, Germany > > Zentrale: +49 421 178 45-6611 > > Besuchsadresse der Nebengeschäftstelle: > Robert-Hooke-Straße 5 > 28359 Bremen, Germany > > Tel.: +49 421 178 45-6614 > Empfang: +49 421 178 45-6600 > Fax: +49 421 178 45-4150 > E-Mail: [email protected] > > Weitere Informationen: http://www.informatik.uni-bremen.de/robotik > > _______________________________________________ > Rock-dev mailing list > [email protected] > http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev _______________________________________________ Rock-dev mailing list [email protected] http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
