<div dir="ltr"><div>Hi,</div><div><br></div><div>I want to visit CXXRecordDecl in my checker. But I am getting error. But it works for FunctionDecl or VaeDecl.</div><div><br></div><div>Following works:</div><div><br></div><div>class MyRuleChecker : public clang::ento::Checker <</div><div>         clang::ento::check::ASTDecl<clang::FunctionDecl> > {</div><div>  public:</div><div>  </div><div>  void   checkASTDecl(const FunctionDecl *D,</div><div>                                     AnalysisManager &Mgr,</div><div>                                     BugReporter &BR) const</div><div>   {</div><div>      return;</div><div>   }</div><div>  </div><div>  }; </div><div><br></div>But following does not work:<div><br></div><div><div>class MyRuleChecker : public clang::ento::Checker <</div><div>         clang::ento::check::ASTDecl<CXXRecordDecl> > {</div><div>  public:</div><div>  </div><div>    checkASTDecl(const CXXRecordDecl *D,</div><div>                                     AnalysisManager &Mgr,</div><div>                                     BugReporter &BR) const</div><div>   {</div><div>      //return;</div><div>   }</div><div>  </div><div>  };</div><div><br></div><div>It gives error:</div><div><br></div><div><div>MyRuleChecker.cpp:116:38:   required from here</div><div>/home/anand/Desktop/static1/llvm/include/llvm/Support/Casting.h:56:28: error: incomplete type ‘clang::CXXRecordDecl’ used in nested name specifier</div><div>     return To::classof(&Val);</div><div>                            ^</div><div>/home/anand/Desktop/static1/llvm/include/llvm/Support/Casting.h: In static member function ‘static bool llvm::isa_impl<To, From, Enabler>::doit(const From&) [with To = clang::CXXRecordDecl; From = clang::Decl; Enabler = void]’:</div><div>/home/anand/Desktop/static1/llvm/include/llvm/Support/Casting.h:57:3: warning: control reaches end of non-void function [-Wreturn-type]</div><div>   }</div><div>   ^</div></div><div>Thanks & Regars</div>
</div></div>