[cfe-dev] Not getting expected Decls (possible newbie mistake)

Pascal Dennerly dnnrly at gmail.com
Mon Feb 22 14:41:54 PST 2010


==Stuff.h==
namespace Stuff
{
    template< typename A, int B >
    class Thingy
    {
    public:
        Thingy() {}

    private:
        int data;
    };
}

==Stuff.cpp==
#include "Stuff.h"
Stuff::Thingy< double, 2 > gThing;
void funcy()
{
    int i;
    i++;
}

I tried to write an AST consumer that would iterate over the Decls in the
HandleTranslationUnit method but  when I ran it over the above code only got
__builtin_va_list (as a TypedefDecl) and 2 VarDecls as for "Stuff". I was
expecting a RecordDecl for the Thingy class and decl for the class.

I don't suppose someone would be able to tell me why I'm so far off base?
(Or point me to the relevent documentation - I'm rather familiar with the
ASTContext/ASTConsumer/Type/Decl/DeclContext Doxygen output at this point!)

Many thanks in advance - I suspect I'm missing something rather obvious!
Pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100222/ef26e054/attachment.html>


More information about the cfe-dev mailing list