ast-dump issue...


  using clang from the trunk of today, I get when doing:

clang-cc ll.cxx -ast-dump

an assertion failure in DeclPrinter.cpp:

typedef __int128_t __int128_t;
typedef __uint128_t __uint128_t;
struct __va_list_tag {
     struct __va_list_tag;
     unsigned int gp_offset;
     unsigned int fp_offset;
     void *overflow_arg_area;
     void *reg_save_area;
     inline __va_list_tag();
     inline __va_list_tag(struct __va_list_tag const &);
     inline struct __va_list_tag &operator=(struct __va_list_tag const &);
     inline ~__va_list_tag();
typedef struct __va_list_tag __va_list_tag;
typedef __va_list_tag __builtin_va_list[1];
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
typedef int __darwin_ct_rune_t;
Assertion failed: (0 && "Unknown declarator!"), function GetBaseType, file /Users/rdm/llvm/src/tools/clang/lib/AST/DeclPrinter.cpp, line 105.
0 clang-cc 0x0000000100ccfee7 PrintStackTrace(void*) + 38
1 clang-cc 0x0000000100cd0475 SignalHandler(int) + 336
2 libSystem.B.dylib 0x00007fff882480aa _sigtramp + 26
3 libSystem.B.dylib 0x00007fff881ecb2a tiny_malloc_from_free_list + 1196
4 libSystem.B.dylib 0x00007fff882c40b4 __pthread_markcancel + 0
5 clang-cc 0x00000001003f888f GetBaseType(clang::QualType) + 240
6 clang-cc 0x00000001003f8d08 (anonymous namespace)::DeclPrinter::VisitDeclContext(clang::DeclContext*, bool) + 580
7 clang-cc 0x00000001003f9cdd (anonymous namespace)::DeclPrinter::VisitTranslationUnitDecl(clang::TranslationUnitDecl*) + 63
8 clang-cc 0x00000001003f9e24 clang::DeclVisitor<(anonymous namespace)::DeclPrinter, void>::Visit(clang::Decl*) + 324
9 clang-cc 0x00000001003f88f9 clang::Decl::print(llvm::raw_ostream&, clang::PrintingPolicy const&, unsigned int) const + 71
10 clang-cc 0x0000000100039b6e (anonymous namespace)::ASTPrinter::HandleTranslationUnit(clang::ASTContext&) + 118
11 clang-cc 0x00000001002847e0 clang::ParseAST(clang::Preprocessor&, clang::ASTConsumer*, clang::ASTContext&, bool, bool, clang::CodeCompleteConsumer* (*)(clang::Sema&, void*), void*) + 760
12 clang-cc 0x000000010002ba21 ProcessInputFile(clang::Preprocessor&, clang::PreprocessorFactory&, std::string const&, ProgActions, llvm::StringMap<bool, llvm::MallocAllocator> const&, llvm::LLVMContext&) + 3664
13 clang-cc 0x000000010002d137 main + 3269
14 clang-cc 0x00000001000270dc start + 52
Stack dump:
0. Program arguments: /Users/rdm/llvm/inst/libexec/clang-cc ll.cxx -ast-dump
1. <eof> parser at end of file
Abort trap

Do I miss some specific additional command line options or is this a real issue?

The ll.cxx file is attached.

Cheers, Fons.

ll.cxx (208 Bytes)

We haven't kept up with -ast-dump (or -ast-print).
Patches are welcome; or go ahead and file a bug report.

- Fariborz