[cfe-dev] pch generation of C++ header failure...

Fons Rademakers Fons.Rademakers at cern.ch
Tue Oct 6 12:16:00 PDT 2009


Hi Doug,

  thanks for the prompt answers. Really helps us going... Axel will be 
working on querying the AST so I hope he will be able to help plug a lot of 
holes (soon).

Concerning the partial template specialization issue any known ETA? Due to 
this assertion there are about 70 of the 1250 headers that fail. Very 
encouraging.


Cheers, Fons.


Douglas Gregor wrote:
> 
> On Oct 6, 2009, at 10:40 AM, Fons Rademakers wrote:
> 
>> Ok, that makes sense. ;-) I am currently checking our C++ project headers
>> to see if they parse correctly. I use:
>>
>> clang-cc -x=c++-header -fsyntax-only myheader.h
>>
>> is that the correct command to check the C++ parser?
> 
> Yes, that works. I tend to use
> 
>     clang -x c++ -fsyntax-only myheader.h
> 
>> In a number of our
>> 1250 headers I get:
>>
>> ====== root/include/TGeoCache.h =========
>> Assertion failed: (Access != AS_none && "Access specifier is AS_none 
>> inside
>> a record decl"), function CheckAccessDeclContext, file
>> /Users/rdm/llvm/src/tools/clang/lib/AST/DeclBase.cpp, line 401.
>> 0   clang-cc          0x0000000100ccfee7 PrintStackTrace(void*) + 38
>> 1   clang-cc          0x0000000100cd0475 SignalHandler(int) + 336
>> 2   libSystem.B.dylib 0x00007fff882480aa _sigtramp + 26
>> 3   clang-cc          0x00000001002849aa
>> clang::DeclarationName::getTombstoneMarker() + 24
>> 4   libSystem.B.dylib 0x00007fff882c40b4 __pthread_markcancel + 0
>> 5   clang-cc          0x00000001003e534d
>> clang::Decl::CheckAccessDeclContext() const + 135
>> 6   clang-cc          0x00000001003af121 clang::Decl::getAccess() 
>> const + 21
>> 7   clang-cc          0x00000001003a9d21 (anonymous
>> namespace)::TemplateDeclInstantiator::VisitCXXRecordDecl(clang::CXXRecordDecl*) 
>>
>> + 193
>> 8   clang-cc          0x00000001003a9dd5 clang::DeclVisitor<(anonymous
>> namespace)::TemplateDeclInstantiator,
>> clang::Decl*>::VisitClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl*) 
>>
>> + 29
>> 9   clang-cc          0x00000001003a9df5 clang::DeclVisitor<(anonymous
>> namespace)::TemplateDeclInstantiator,
>> clang::Decl*>::VisitClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl*) 
>>
>> + 29
>>
>> which the most common assert I encounter. Any idea which construct 
>> causes this?
> 
> This is probably because we aren't yet able to instantiate class 
> template partial specializations that occur within a class template. 
> This feature is used in libstdc++'s <map>.
> 
>> Other question, if they parse correctly, does that mean that the AST is
>> correct/complete and that we should be able to query the class properties
>> (list of data members, methods, etc) via the AST API?
> 
> 
> In theory, yes. In practice, there's lots of debugging to do and there 
> are still many holes to plug. We could use some help!
> 
>     - Doug

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers at cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640



More information about the cfe-dev mailing list