[LLVMbugs] [Bug 16182] New: RecursiveASTVisitor does not visit parameter of implicit function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 30 10:22:57 PDT 2013


            Bug ID: 16182
           Summary: RecursiveASTVisitor does not visit parameter of
                    implicit function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: atzannes at illinois.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10599
  --> http://llvm.org/bugs/attachment.cgi?id=10599&action=edit
source code with implicit 'operator=' function that gets visited, but its
parameter doesn't

I'm visiting the code (see attached file) using the RecursiveASTVisitor and my
problem is that the parameter of the implicit function is not visited because
getTypeSourceInfo() returns null on line 1739 of RecursiveASTVisitor.h

-- RecursiveASTVisitor.h:lines 1735-1741 ----------------------------

  // Visit the function type itself, which can be either
  // FunctionNoProtoType or FunctionProtoType, or a typedef.  This
  // also covers the return type and the function parameters,
  // including exception specifications.
  if (TypeSourceInfo *TSI = D->getTypeSourceInfo()) {


Nevertheless, dumping the AST node for the CXXMethod (operator=) reveals that a
nameless parameter is properly created.

Note: All three "should" functions of my visitor return true:
  bool shouldVisitImplicitCode() const { return true; }
  bool shouldWalkTypesOfTypeLocs() const { return true; } 
  bool shouldVisitTemplateInstantiations() const { return true; }

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/20130530/6a553da6/attachment.html>

More information about the llvm-bugs mailing list