[llvm-bugs] [Bug 26087] New: Building clangDynamicASTMatchers fails on Visual Studio 2015 in REGISTER_MATCHER(hasDeclaration);

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 8 13:45:54 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26087

            Bug ID: 26087
           Summary: Building clangDynamicASTMatchers fails on Visual
                    Studio 2015 in REGISTER_MATCHER(hasDeclaration);
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jujjyl at gmail.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Attempting to build LLVM+Clang from sources on Windows Visual Studio 2015, it
is failing in tools\clang\lib\ASTMatchers\Dynamic\Registry.cpp on line 206 with 

REGISTER_MATCHER(hasDeclaration);

giving the following error messages that go inside templated code:

1>------ Build started: Project: clangDynamicASTMatchers, Configuration: Debug
x64 ------
1>  Registry.cpp
1>C:\code\emsdk\clang\fastcomp\src\tools\clang\include\clang/ASTMatchers/ASTMatchersInternal.h(669):
error C2664: 'bool
clang::ast_matchers::internal::HasDeclarationMatcher<T,P1>::matchesSpecialized(const
clang::MemberExpr &,clang::ast_matchers::internal::ASTMatchFinder
*,clang::ast_matchers::internal::BoundNodesTreeBuilder *) const': cannot
convert argument 1 from 'const clang::DeclRefExpr' to 'const clang::QualType &'
1>          with
1>          [
1>              T=clang::DeclRefExpr,
1>              P1=clang::ast_matchers::internal::Matcher<clang::Decl>
1>          ]
1> 
C:\code\emsdk\clang\fastcomp\src\tools\clang\include\clang/ASTMatchers/ASTMatchersInternal.h(669):
note: Reason: cannot convert from 'const clang::DeclRefExpr' to 'const
clang::QualType'
1> 
C:\code\emsdk\clang\fastcomp\src\tools\clang\include\clang/ASTMatchers/ASTMatchersInternal.h(669):
note: No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
1> 
C:\code\emsdk\clang\fastcomp\src\tools\clang\include\clang/ASTMatchers/ASTMatchersInternal.h(668):
note: while compiling class template member function 'bool
clang::ast_matchers::internal::HasDeclarationMatcher<T,P1>::matches(const T
&,clang::ast_matchers::internal::ASTMatchFinder
*,clang::ast_matchers::internal::BoundNodesTreeBuilder *) const'
1>          with
1>          [
1>              T=clang::DeclRefExpr,
1>              P1=clang::ast_matchers::internal::Matcher<clang::Decl>
1>          ]
1> 
C:\code\emsdk\clang\fastcomp\src\tools\clang\include\clang/ASTMatchers/ASTMatchersInternal.h(1032):
note: see reference to class template instantiation
'clang::ast_matchers::internal::HasDeclarationMatcher<T,P1>' being compiled
1>          with
1>          [
1>              T=clang::DeclRefExpr,
1>              P1=clang::ast_matchers::internal::Matcher<clang::Decl>
1>          ]
1> 
c:\code\emsdk\clang\fastcomp\src\tools\clang\lib\astmatchers\dynamic\Marshallers.h(220):
note: see reference to function template instantiation
'clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>::operator
clang::ast_matchers::internal::Matcher<TargetT>(void) const<TargetT>' being
compiled
1>          with
1>          [
1>              TargetT=clang::DeclRefExpr
1>          ]
1> 
c:\code\emsdk\clang\fastcomp\src\tools\clang\lib\astmatchers\dynamic\Marshallers.h(220):
note: see reference to function template instantiation
'clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>::operator
clang::ast_matchers::internal::Matcher<TargetT>(void) const<TargetT>' being
compiled
1>          with
1>          [
1>              TargetT=clang::DeclRefExpr
1>          ]
1> 
c:\code\emsdk\clang\fastcomp\src\tools\clang\lib\astmatchers\dynamic\Marshallers.h(221):
note: see reference to function template instantiation 'void
clang::ast_matchers::dynamic::internal::mergePolyMatchers<PolyMatcher,clang::ast_matchers::internal::TypeList<clang::DeclRefExpr,clang::EnumType,clang::InjectedClassNameType,clang::LabelStmt,clang::MemberExpr,clang::QualType,clang::RecordType,clang::TagType,clang::TemplateSpecializationType,clang::TemplateTypeParmType,clang::TypedefType,clang::UnresolvedUsingType>>(const
PolyMatcher
&,std::vector<clang::ast_matchers::internal::DynTypedMatcher,std::allocator<_Ty>>
&,TypeList)' being compiled
1>          with
1>          [
1>             
PolyMatcher=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,
1>              _Ty=clang::ast_matchers::internal::DynTypedMatcher,
1>             
TypeList=clang::ast_matchers::internal::TypeList<clang::DeclRefExpr,clang::EnumType,clang::InjectedClassNameType,clang::LabelStmt,clang::MemberExpr,clang::QualType,clang::RecordType,clang::TagType,clang::TemplateSpecializationType,clang::TemplateTypeParmType,clang::TypedefType,clang::UnresolvedUsingType>
1>          ]
1> 
c:\code\emsdk\clang\fastcomp\src\tools\clang\lib\astmatchers\dynamic\Marshallers.h(221):
note: see reference to function template instantiation 'void
clang::ast_matchers::dynamic::internal::mergePolyMatchers<PolyMatcher,clang::ast_matchers::internal::TypeList<clang::CXXConstructExpr,clang::DeclRefExpr,clang::EnumType,clang::InjectedClassNameType,clang::LabelStmt,clang::MemberExpr,clang::QualType,clang::RecordType,clang::TagType,clang::TemplateSpecializationType,clang::TemplateTypeParmType,clang::TypedefType,clang::UnresolvedUsingType>>(const
PolyMatcher
&,std::vector<clang::ast_matchers::internal::DynTypedMatcher,std::allocator<_Ty>>
&,TypeList)' being compiled
1>          with
1>          [
1>             
PolyMatcher=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,
1>              _Ty=clang::ast_matchers::internal::DynTypedMatcher,
1>             
TypeList=clang::ast_matchers::internal::TypeList<clang::CXXConstructExpr,clang::DeclRefExpr,clang::EnumType,clang::InjectedClassNameType,clang::LabelStmt,clang::MemberExpr,clang::QualType,clang::RecordType,clang::TagType,clang::TemplateSpecializationType,clang::TemplateTypeParmType,clang::TypedefType,clang::UnresolvedUsingType>
1>          ]
1> 
c:\code\emsdk\clang\fastcomp\src\tools\clang\lib\astmatchers\dynamic\Marshallers.h(239):
note: see reference to function template instantiation 'void
clang::ast_matchers::dynamic::internal::mergePolyMatchers<T,clang::ast_matchers::internal::TypeList<clang::CallExpr,clang::CXXConstructExpr,clang::DeclRefExpr,clang::EnumType,clang::InjectedClassNameType,clang::LabelStmt,clang::MemberExpr,clang::QualType,clang::RecordType,clang::TagType,clang::TemplateSpecializationType,clang::TemplateTypeParmType,clang::TypedefType,clang::UnresolvedUsingType>>(const
PolyMatcher
&,std::vector<clang::ast_matchers::internal::DynTypedMatcher,std::allocator<_Ty>>
&,TypeList)' being compiled
1>          with
1>          [
1>             
T=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,
1>             
PolyMatcher=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,
1>              _Ty=clang::ast_matchers::internal::DynTypedMatcher,
1>             
TypeList=clang::ast_matchers::internal::TypeList<clang::CallExpr,clang::CXXConstructExpr,clang::DeclRefExpr,clang::EnumType,clang::InjectedClassNameType,clang::LabelStmt,clang::MemberExpr,clang::QualType,clang::RecordType,clang::TagType,clang::TemplateSpecializationType,clang::TemplateTypeParmType,clang::TypedefType,clang::UnresolvedUsingType>
1>          ]
1> 
c:\code\emsdk\clang\fastcomp\src\tools\clang\lib\astmatchers\dynamic\Marshallers.h(435):
note: see reference to function template instantiation
'clang::ast_matchers::dynamic::VariantMatcher
clang::ast_matchers::dynamic::internal::outvalueToVariantMatcher<ReturnType>(const
T
&,clang::ast_matchers::internal::TypeList<clang::CallExpr,clang::CXXConstructExpr,clang::DeclRefExpr,clang::EnumType,clang::InjectedClassNameType,clang::LabelStmt,clang::MemberExpr,clang::QualType,clang::RecordType,clang::TagType,clang::TemplateSpecializationType,clang::TemplateTypeParmType,clang::TypedefType,clang::UnresolvedUsingType>
*)' being compiled
1>          with
1>          [
1>             
ReturnType=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,
1>             
T=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>
1>          ]
1> 
c:\code\emsdk\clang\fastcomp\src\tools\clang\lib\astmatchers\dynamic\Marshallers.h(641):
note: see reference to function template instantiation
'clang::ast_matchers::dynamic::VariantMatcher
clang::ast_matchers::dynamic::internal::matcherMarshall1<ReturnType,ArgType1>(void
(__cdecl
*)(void),llvm::StringRef,clang::ast_matchers::dynamic::SourceRange,llvm::ArrayRef<clang::ast_matchers::dynamic::ParserValue>,clang::ast_matchers::dynamic::Diagnostics
*)' being compiled
1>          with
1>          [
1>             
ReturnType=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,
1>              ArgType1=const
clang::ast_matchers::internal::Matcher<clang::Decl> &
1>          ]
1> 
C:\code\emsdk\clang\fastcomp\src\tools\clang\lib\ASTMatchers\Dynamic\Registry.cpp(206):
note: see reference to function template instantiation
'clang::ast_matchers::dynamic::internal::MatcherDescriptor
*clang::ast_matchers::dynamic::internal::makeMatcherAutoMarshall<clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,const
clang::ast_matchers::internal::Matcher<clang::Decl>&>(ReturnType (__cdecl
*)(ArgType1),llvm::StringRef)' being compiled
1>          with
1>          [
1>             
ReturnType=clang::ast_matchers::internal::PolymorphicMatcherWithParam1<clang::ast_matchers::internal::HasDeclarationMatcher,clang::ast_matchers::internal::Matcher<clang::Decl>,void
(clang::ast_matchers::internal::HasDeclarationSupportedTypes)>,
1>              ArgType1=const
clang::ast_matchers::internal::Matcher<clang::Decl> &
1>          ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160108/00f6e2e5/attachment-0001.html>


More information about the llvm-bugs mailing list