[cfe-dev] Can't resolve Sema::ActOnClassTemplate, clang-cc build fail

ether zhhb etherzhhb at gmail.com
Fri Apr 17 23:51:42 PDT 2009


Hi,

Yes, I post again...

Today I was trying to build clang revision 69421 and fail with the
message like this:

2>clangSema.lib(ParseAST.obj) : error LNK2001: external symbol could
not be resolved(ah, my visual studio is not english version, and my
english is poor)
"public: virtual class clang::ActionBase::ActionResult<5,class
clang::OpaquePtr<0>,1> __thiscall
clang::Sema::ActOnClassTemplate(class clang::Scope *,unsigned int,enum
clang::Action::TagKind,class clang::SourceLocation,class
clang::CXXScopeSpec const &,class clang::IdentifierInfo *,class
clang::SourceLocation,class clang::AttributeList *,

class clang::ASTMultiPtr<&[thunk]: __thiscall
clang::ExternalASTSource::`vcall'{12,{flat}}' }'>,

     ~~~~~~~~~~~~~~~

enum clang::AccessSpecifier)"
(?ActOnClassTemplate at Sema@clang@@UAE?AV?$ActionResult@$04V?$OpaquePtr@$0A@@clang@@$00 at ActionBase@2 at PAVScope@2 at IW4TagKind@Action at 2@VSourceLocation at 2@ABVCXXScopeSpec at 2@PAVIdentifierInfo at 2@2PAVAttributeList at 2@V?$ASTMultiPtr@$1??_9ExternalASTSource at clang@@$BM at AE@2 at W4AccessSpecifier@2@@Z)

and then, I do things below:

 1. I found out the definition of Sema::ActOnClassTemplate
(SemaTemplate at line 399) and then comment it, then I got the message
like this:

clangSema.lib(Sema.obj) : error LNK2001:  external symbol could not be resolved
"public: virtual class clang::ActionBase::ActionResult<5,class
clang::OpaquePtr<0>,1> __thiscall
clang::Sema::ActOnClassTemplate(class clang::Scope *,unsigned int,enum
clang::Action::TagKind,class clang::SourceLocation,class
clang::CXXScopeSpec const &,class clang::IdentifierInfo *,class
clang::SourceLocation,class clang::AttributeList *,


class clang::ASTMultiPtr<&[thunk]: __thiscall
clang::ActionBase::`vcall'{12,{flat}}' }'>,

~~~~~~~~~~~~~~~~~~~~~~~~~~~

enum clang::AccessSpecifier)"
(?ActOnClassTemplate at Sema@clang@@UAE?AV?$ActionResult@$04V?$OpaquePtr@$0A@@clang@@$00 at ActionBase@2 at PAVScope@2 at IW4TagKind@Action at 2@VSourceLocation at 2@ABVCXXScopeSpec at 2@PAVIdentifierInfo at 2@2PAVAttributeList at 2@V?$ASTMultiPtr@$1??_9ActionBase at clang@@$BM at AE@2 at W4AccessSpecifier@2@@Z)

2. I found out the code which invoking ParserAST  (clang-cc.cpp at
line 2194) and comment it, then I could build clang-cc without any
error message.

3. I found that the ActOnClassTemplate was been ony invoked in
ParseDeclCXX at line 500 like this:

TagOrTempResult = Actions.ActOnClassTemplate(CurScope, TagType, TK,
StartLoc, SS, Name, NameLoc, Attr,

                       Action::MultiTemplateParamsArg(Actions,
&(*TemplateParams)[0], TemplateParams->size()),

AS);

it seem to do not have any problem, then i comment it and compile,
there is still the same error message


 so, I think the error occur because  ActOnClassTemplate has been
invoked somewhere with the wrong parameter
(ASTMultiPtr<&ExternalASTSource::DeleteTemplateParams> instead of
ASTMultiPtr<&ActionBase::DeleteTemplateParams>), or it just a bug of
the compiler?

I will keep on to found out the problem as posssible as i can, and
thank you for any advice.

--
ether




More information about the cfe-dev mailing list